The following code starts in column B. It bolds the first value of a row and changes the font to a lighter shade/tint if it is repeated on the following row.
Question: for the bold rows, the value in the 4th column needs to be copied on the same row in column 33.
Efficiency counts. This report can have 35,000 rows.
ObjXL.Range("B" & intRowPos & ":B" & intMaxRecordCount + (intRowPos)).Select
For Each c In ObjXL.ActiveWindow.Selection
If c.Value <> c.Offset(-1, 0).Value Then
c.Font.FontStyle = "Bold"
c.Resize(, 6).Font.Bold = True
' goal: Copy value in 4th column and past it in column 33
Else
c.Font.ThemeColor = xlThemeColorDark1
c.Font.TintAndShade = -0.249977111
c.Resize(, 5).Font.ThemeColor = xlThemeColorDark1
c.Resize(, 5).Font.TintAndShade = -0.249977111
c.Resize(, 6).Font.Bold = True
End If
Next c
Set c = Nothing
This code is running from inside MS Access
ObjXL is an object varable for Excel.Application
Bookmarks