![]() |
Selecting a column with an integer
Sub ColumnSelection()
' Selecting a column with an integer ' Please show me how to eliminate the use of Cells(1, 1) Dim r As Integer Dim c As String Dim numericcolumn As Integer Dim alphabetcolumn As String numericcolumn = 4 ' in practice 4 is the resultant of an equation alphabetcolumn = "=CHAR(" & numericcolumn + 64 & ")" Cells(1, 1) = alphabetcolumn ' I like to eliminate the use of Cells(1, 1) c = Cells(1, 1).Value ' I like to eliminate the use of Cells(1, 1) Cells(1, 1) = "" ' I like to eliminate the use of Cells(1, 1) Columns("" & c & ":" & c & "").Select End Sub |
lashio,
Columns(numericcolumn).Select Jim Cone San Francisco, USA "lashio" wrote in message ... Sub ColumnSelection() ' Selecting a column with an integer ' Please show me how to eliminate the use of Cells(1, 1) Dim r As Integer Dim c As String Dim numericcolumn As Integer Dim alphabetcolumn As String in practice 4 is the resultant of an equation numericcolumn = 4 alphabetcolumn = "=CHAR(" & numericcolumn + 64 & ")" I like to eliminate the use of Cells(1, 1) Cells(1, 1) = alphabetcolumn c = Cells(1, 1).Value Cells(1, 1) = "" Columns("" & c & ":" & c & "").Select End Sub |
Jim,
Amazing! Thank you very much. "Jim Cone" wrote in message ... lashio, Columns(numericcolumn).Select Jim Cone San Francisco, USA "lashio" wrote in message ... Sub ColumnSelection() ' Selecting a column with an integer ' Please show me how to eliminate the use of Cells(1, 1) Dim r As Integer Dim c As String Dim numericcolumn As Integer Dim alphabetcolumn As String in practice 4 is the resultant of an equation numericcolumn = 4 alphabetcolumn = "=CHAR(" & numericcolumn + 64 & ")" I like to eliminate the use of Cells(1, 1) Cells(1, 1) = alphabetcolumn c = Cells(1, 1).Value Cells(1, 1) = "" Columns("" & c & ":" & c & "").Select End Sub |
All times are GMT +1. The time now is 07:36 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com