Creating a VBScript to update tables from a spreadsheet:
For RowCount = 2 To Worksheets(“Data”).UsedRange.Rows.Count() + 1
If Worksheets(“Data”).Cells(RowCount, 1) = cmbYear.Text Then
For tables = 0 To 2
If Worksheets(“Data”).Cells(RowCount, 6) = servicetypes(tables) Then
For brands = 0 To 4
If Worksheets(“Data”).Cells(RowCount, 5) = arrbrands(brands) Then
For salestage = 0 To 2
If CInt(Left(Worksheets(“Data”).Cells(RowCount, 9), 1)) > 0 Then
Month(tables, brands, salestage) = Month(tables, brands, salestage) + Worksheets(“Data”).Cells(RowCount, salestage + 21)
Worksheets(“FCQ1”).Cells(months(tables, salestage), brands + 4) = Month(tables, brands, salestage)
For totalmonthscount = 0 To 2
totalmonthsarr(tables, brands, salestage, totalmonthscount) = totalmonthsarr(tables, brands, salestage, totalmonthscount) + Worksheets(“Data”).Cells(RowCount, totalmonths(salestage, totalmonthscount))
Worksheets(“FCQ1”).Cells((months(tables, salestage)) + totalmonthscount, brands + 4) = totalmonthsarr(tables, brands, salestage, totalmonthscount)
Next
End If
Next
End If
Next
End If
Next
End If
Next
For RowCount = 2 To Worksheets(“Data”).UsedRange.Rows.Count() + 1 If Worksheets(“Data”).Cells(RowCount, 1) = cmbYear.Text Then For tables = 0 To 2 If Worksheets(“Data”).Cells(RowCount, 6) = servicetypes(tables) Then For brands = 0 To 4 If Worksheets(“Data”).Cells(RowCount, 5) = arrbrands(brands) Then For salestage = 0 To 2 If CInt(Left(Worksheets(“Data”).Cells(RowCount, 9), 1)) > 0 Then Month(tables, brands, salestage) = Month(tables, brands, salestage) + Worksheets(“Data”).Cells(RowCount, salestage + 21) Worksheets(“FCQ1”).Cells(months(tables, salestage), brands + 4) = Month(tables, brands, salestage) For totalmonthscount = 0 To 2 totalmonthsarr(tables, brands, salestage, totalmonthscount) = totalmonthsarr(tables, brands, salestage, totalmonthscount) + Worksheets(“Data”).Cells(RowCount, totalmonths(salestage, totalmonthscount)) Worksheets(“FCQ1”).Cells((months(tables, salestage)) + totalmonthscount, brands + 4) = totalmonthsarr(tables, brands, salestage, totalmonthscount) Next End If Next End If Next End If Next End If Next
0.000000
0.000000
Like this:
Like Loading...
Related
Published by Thys Michels
Cloud Architect - Salesforce and everything related
View all posts by Thys Michels