Column conversion
How can I convert a column from alpha to numeric?
i.e. convert BZ to 78 Is there a simple conversion or do I have to write my own? I have data in cols A and B and BZ-CF. How would I say : Columns("B+1:BZ-1").Select Selection.Delete Shift:=xlToLeft |
Column conversion
You can use a VBA function like
Function ColLetterToNumber(Letter As String) As Integer ColLetterToNumber = Worksheets(1).Range(Letter & "1").Column End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Charlie" wrote in message ... How can I convert a column from alpha to numeric? i.e. convert BZ to 78 Is there a simple conversion or do I have to write my own? I have data in cols A and B and BZ-CF. How would I say : Columns("B+1:BZ-1").Select Selection.Delete Shift:=xlToLeft |
Column conversion
Thanks
"Chip Pearson" wrote in message ... You can use a VBA function like Function ColLetterToNumber(Letter As String) As Integer ColLetterToNumber = Worksheets(1).Range(Letter & "1").Column End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Charlie" wrote in message ... How can I convert a column from alpha to numeric? i.e. convert BZ to 78 Is there a simple conversion or do I have to write my own? I have data in cols A and B and BZ-CF. How would I say : Columns("B+1:BZ-1").Select Selection.Delete Shift:=xlToLeft |
Column conversion
Charlie,
No need to convert: Range(Range("B:B").Offset(0, 1), Range("BZ:BZ").Offset(0, -1)).Select Selection.Delete Shift:=xlToLeft Simpler still is to use this, which will delete the columns where cellas in row 1 are blank: Range("1:1").SpecialCells(xlCellTypeBlanks).Entire Column.Delete HTH, Bernie MS Excel MVP "Charlie" wrote in message ... How can I convert a column from alpha to numeric? i.e. convert BZ to 78 Is there a simple conversion or do I have to write my own? I have data in cols A and B and BZ-CF. How would I say : Columns("B+1:BZ-1").Select Selection.Delete Shift:=xlToLeft |
Column conversion
Thanks
"Bernie Deitrick" <deitbe @ consumer dot org wrote in message ... Charlie, No need to convert: Range(Range("B:B").Offset(0, 1), Range("BZ:BZ").Offset(0, -1)).Select Selection.Delete Shift:=xlToLeft Simpler still is to use this, which will delete the columns where cellas in row 1 are blank: Range("1:1").SpecialCells(xlCellTypeBlanks).Entire Column.Delete HTH, Bernie MS Excel MVP "Charlie" wrote in message ... How can I convert a column from alpha to numeric? i.e. convert BZ to 78 Is there a simple conversion or do I have to write my own? I have data in cols A and B and BZ-CF. How would I say : Columns("B+1:BZ-1").Select Selection.Delete Shift:=xlToLeft |
Column conversion
Another one:
Range("C:BY").Delete -- Regards, Tom Ogilvy "Charlie" wrote in message ... Thanks "Chip Pearson" wrote in message ... You can use a VBA function like Function ColLetterToNumber(Letter As String) As Integer ColLetterToNumber = Worksheets(1).Range(Letter & "1").Column End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Charlie" wrote in message ... How can I convert a column from alpha to numeric? i.e. convert BZ to 78 Is there a simple conversion or do I have to write my own? I have data in cols A and B and BZ-CF. How would I say : Columns("B+1:BZ-1").Select Selection.Delete Shift:=xlToLeft |
All times are GMT +1. The time now is 01:01 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com