Hi,
I'm using a spreadsheet that is updated often, new rows and columns are added almost daily. I'm trying to use a loop to start as a column select all the data in the column apply the conditional formatting then move to the next column.
I know how to use a macro and apply the conditional formatting however, I'm struggling with trying to move along each column. Here is what I have so far:
Dim LastColumn As Long
Dim lngRows As Long
Dim rngC As Range
LastColumn = Cells(1, Columns.Count).End(xlToLeft).Column
lngRows = Cells(Rows.Count, 1).End(xlUp).Row
Range("A1").Select
Set rngC = Selection.CurrentRegion
For j = 6 To LastColumn
StartCel = Cells(2, j)
LastCel = Cells(lngRows, j)
Range(StartCel, LastCel).Select
Next
I continue to get an error message saying I'm out of range when the program gets to "Range(StartCel,LastCel).Select".
In summary I want to just have a loop that goes through the spreadsheet and selects all the data in Column F then in column G,H etc.
I did not include my code about conditional formatting.
please help!
Thank you in advance for taking the time to help me!
Bookmarks