DataBlake
Well-known Member
- Joined
- Jan 26, 2015
- Messages
- 781
- Office Version
- 2016
- Platform
- Windows
I have this code and its not working, can anyone explain to me why?
or
the only alternative i can think of is change lastCol to a string and use
Code:
sub test()
Dim lastCol As Long
with activesheet
lastCol = .Range("A1").SpecialCells(xlCellTypeLastCell).Column
Columns(17 & ":" & lastCol).Delete Shift:=xlToLeft
end with
or
Code:
sub test()
Dim lastCol As Long
with activesheet
lastCol = .Range("A1").SpecialCells(xlCellTypeLastCell).Column
Range(0, 17 & ":" & lastCol).Delete Shift:=xlToLeft
end with
the only alternative i can think of is change lastCol to a string and use
Code:
range("T:" & lastCol)