Greetings,
I'm trying to dynamically reference the last column using
. I can't seem to figure out how to convert the column reference from a number to a letter.
Sub RestorePivtTable()
Set ws = ThisWorkbook.Sheets("sheet1")
llc = ws.Cells(2, ws.Columns.count).End(xlToLeft).Column
Columns("E:" & llc.address & "").Select
Selection.ClearFormats
End Sub
These other methods have failed as well.
'Columns("1:" & lc.Address & "").Select
'Columns(1, llc).Select
'Range(Columns(1), Columns(llc)).Select
'Columns("E:" & Cells(3, llc).Address & "").Select
'Range("1:" & Cells(3, lc).Address & "").Select
'Range(Cells(1, 1).Address, Cells(3, llc).Address).Select
'Columns("" & llc & ":" & llc & "").Select
Bookmarks