Showing posts with label Getting column letter from column number. Show all posts
Showing posts with label Getting column letter from column number. Show all posts

Friday, April 17, 2020

Getting column letter from column number,selecting the column and change the column format using vba

'MsgBox (Split(Cells(1, ActiveCell.Column).address, "$")(1))
Dim rangecol As Range
Set rangecol = Range(Split(Cells(1, ActiveCell.Column).address, "$")(1) & ":" & Split(Cells(1, ActiveCell.Column).address, "$")(1))
'MsgBox (rangecol.address)

rangecol.NumberFormat = "General"