Whisperer14
Well-known Member
- Joined
- Nov 6, 2002
- Messages
- 589
What is the efficient way to convert a known column number to its corresponding letter - with acknowledgements to Aladin for the R1C1 formula...
Lastcol is the known column number, iStr a string variable
TIA GT
Lastcol is the known column number, iStr a string variable
Code:
Cells(1, LastCol).FormulaR1C1 = "=SUBSTITUTE(ADDRESS(1,COLUMN(),4),""1"","""")"
iStr = Cells(1, LastCol).Value
Cells(1, LastCol).ClearContents 'just to tidy up the sheet
Columns("E" & iStr).Copy
etc...
TIA GT