Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSV Column Conversion CJ Melo Excel Worksheet Functions 2 October 31st 09 01:23 AM
Row to column conversion [email protected] Excel Discussion (Misc queries) 4 October 6th 08 03:33 AM
Perpelexing Row to Column conversion Geno Excel Discussion (Misc queries) 3 July 7th 06 04:04 PM
Excel Column and row conversion MSM Excel Discussion (Misc queries) 1 May 7th 05 03:12 PM
How to use a conversion function in a whole column Terence[_2_] Excel Programming 1 July 28th 03 11:12 AM


All times are GMT +1. The time now is 01:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"