I have a sub that exports my form's 4 subforms onto one worksheet in Excel. I'm now working on the formatting portion and I'm stuck on the row after last row.
This is what I tried, but it tells me that .Rows is an invalid or unqualified reference.
Code:
Lrow = .Range("A" & .Rows.Count).End(xlUp).Row
Lcol = .Cells(lRow, .Columns.Count).End(xlToLeft).Column
Set rng1 = .Range(.Cells(Lrow + 1, 1), .Cells(Lrow + 1, Lcol))
I'm not finding any help in the VBA reference either. Does anyone know how to find the last row? In full transparency I want Lcol to be P:P because I have other subforms in columns to the right.
I want to find the last row and format the row beneath it to be black with white font (.interior.ColorIndex = 1 etc..) But I don't know the range... range = .Range(.Cells(Lrow +1, 1), .Cells(Lrow +1, LCol))???
UPDATE:
I found how to find the last row +1: Lrow = wks.Cells(Rows.Count, "A").End(xlUp).Row + 1
Now I need to figure out how to make the range, Lrow A:P