Please write me a VBA code that will do the following. In Workbook 'Service Providers'…
- User
Please write me a VBA code that will do the following.
In Workbook 'Service Providers' find the sheet with the same name as the value in 'K1' of my current sheet 'CTasks Specific' in workbook 'Service Providers Analysis'
For each value in my current sheet range A3:A18 find the number of times the value occurs in the workbook 'Service Providers' for the sheet found (as per above) in the range B6:B36 and apend the number to Offset(0, 1) of the searced value in my current sheet 'CTasks Specific' in workbook 'Service Providers Analysis'. Continue this until A18 of my current sheet 'CTasks Specific' in workbook 'Service Providers Analysis'.
After the concluding the event on A18 of my current sheet, open the workbook 'Service Providers History' but do not make visible, and find the sheet with the same name as the value in 'K1' of my current sheet 'CTasks Specific' in workbook 'Service Providers Analysis'
For each value in my current sheet range A3:A18 find the number of times the value occurs in the workbook 'Service Providers History' for the sheet found (as per above) in the range B6:B1006 and apend the number to Offset(0, 2) of the searced value in my current sheet 'CTasks Specific' in workbook 'Service Providers Analysis'. Restore visibity to workbook 'Service Providers History' and Close without saving.
- Assistant
Here is a VBA code that accomplishes the tasks you have described:
vba - User
I would like to modify the code below to do the following:
For Each cell In wsSpecific.Range("A3:A18") occurences = the sum of all values of (rngProviders, cell.Value)
code'Loop through range A3:A18 in CTasks Specific sheet For Each cell In wsSpecific.Range("A3:A18") occurrences = Application.WorksheetFunction.CountIf(rngProviders, cell.Value) cell.Offset(0, 4).Value = occurrences Next cell - Assistant
Here is the modified code that sums all the values in rngProviders based on the criteria in the cell:
vba - User
I would like to modify the code below to do the following:
Instead of finding the number of occurences, find all the matching occurences then calculate the sum of all the values Offset(0, 4) of the matching ocurrences and write the value to the same offset as in the code below (cell.Offset(0, 1).Value = occurrences & cell.Offset(0, 2).Value = occurrences).
Sub TotalSumOccurrences() Dim wbSP As Workbook, wbSPA As Workbook, wbSPH As Workbook Dim wsSpecific As Worksheet, ws As Worksheet Dim cell As Range Dim providersName As String Dim occurrences As Long Dim rngProviders As Range Dim rngHistory As Range
- Assistant