Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there an easy way to get the column number from the column letter in Excel
2002 VBA, similar to the worksheet function =COLUMN(B:B) which equal 2? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
one way Range("B2").Value = Range("D1").Column which would produce the number 4 in cell B2 there are a number of ways to use this. with a variable Dim r As Range Set r = Range("B1") Range("B2").Value = r.Column with activecell range("c1").select Range("B2").Value = activecell.Column and there are others. hope this gets you started regards FSt1 "TWR" wrote: Is there an easy way to get the column number from the column letter in Excel 2002 VBA, similar to the worksheet function =COLUMN(B:B) which equal 2? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, but I Don't want to write any data to the worksheet. I have a
userform that asks in which column certain data is. The response will be the column letter. Thanks for the suggestion though. "FSt1" wrote: hi one way Range("B2").Value = Range("D1").Column which would produce the number 4 in cell B2 there are a number of ways to use this. with a variable Dim r As Range Set r = Range("B1") Range("B2").Value = r.Column with activecell range("c1").select Range("B2").Value = activecell.Column and there are others. hope this gets you started regards FSt1 "TWR" wrote: Is there an easy way to get the column number from the column letter in Excel 2002 VBA, similar to the worksheet function =COLUMN(B:B) which equal 2? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps something like this:
Range(strColEntered & "1").Column Where strColEntered is a variable containing the Column Letter entered by the user. Is that something you can work with? -------------------------- Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "TWR" wrote in message ... Thanks, but I Don't want to write any data to the worksheet. I have a userform that asks in which column certain data is. The response will be the column letter. Thanks for the suggestion though. "FSt1" wrote: hi one way Range("B2").Value = Range("D1").Column which would produce the number 4 in cell B2 there are a number of ways to use this. with a variable Dim r As Range Set r = Range("B1") Range("B2").Value = r.Column with activecell range("c1").select Range("B2").Value = activecell.Column and there are others. hope this gets you started regards FSt1 "TWR" wrote: Is there an easy way to get the column number from the column letter in Excel 2002 VBA, similar to the worksheet function =COLUMN(B:B) which equal 2? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yup, That's the spot. I knew my 14 lines of code was not the best way. How
do you MVP's keep up with all the questions? Thank you !! "Ron Coderre" wrote: Perhaps something like this: Range(strColEntered & "1").Column Where strColEntered is a variable containing the Column Letter entered by the user. Is that something you can work with? -------------------------- Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "TWR" wrote in message ... Thanks, but I Don't want to write any data to the worksheet. I have a userform that asks in which column certain data is. The response will be the column letter. Thanks for the suggestion though. "FSt1" wrote: hi one way Range("B2").Value = Range("D1").Column which would produce the number 4 in cell B2 there are a number of ways to use this. with a variable Dim r As Range Set r = Range("B1") Range("B2").Value = r.Column with activecell range("c1").select Range("B2").Value = activecell.Column and there are others. hope this gets you started regards FSt1 "TWR" wrote: Is there an easy way to get the column number from the column letter in Excel 2002 VBA, similar to the worksheet function =COLUMN(B:B) which equal 2? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're very welcome....I'm glad I could help
*********** Regards, Ron XL2003, WinXP "TWR" wrote: Yup, That's the spot. I knew my 14 lines of code was not the best way. How do you MVP's keep up with all the questions? Thank you !! "Ron Coderre" wrote: Perhaps something like this: Range(strColEntered & "1").Column Where strColEntered is a variable containing the Column Letter entered by the user. Is that something you can work with? -------------------------- Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "TWR" wrote in message ... Thanks, but I Don't want to write any data to the worksheet. I have a userform that asks in which column certain data is. The response will be the column letter. Thanks for the suggestion though. "FSt1" wrote: hi one way Range("B2").Value = Range("D1").Column which would produce the number 4 in cell B2 there are a number of ways to use this. with a variable Dim r As Range Set r = Range("B1") Range("B2").Value = r.Column with activecell range("c1").select Range("B2").Value = activecell.Column and there are others. hope this gets you started regards FSt1 "TWR" wrote: Is there an easy way to get the column number from the column letter in Excel 2002 VBA, similar to the worksheet function =COLUMN(B:B) which equal 2? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
PS: I posted another question titled 'How to get Popup Text help to work' on
1/4. 12.25 AM PST. Chip Pearson answered part of my question about MSForms Controls and Windows handles for them but not actually about whether or not UserForms actually do not support What's This help. "Ron Coderre" wrote: Perhaps something like this: Range(strColEntered & "1").Column Where strColEntered is a variable containing the Column Letter entered by the user. Is that something you can work with? -------------------------- Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "TWR" wrote in message ... Thanks, but I Don't want to write any data to the worksheet. I have a userform that asks in which column certain data is. The response will be the column letter. Thanks for the suggestion though. "FSt1" wrote: hi one way Range("B2").Value = Range("D1").Column which would produce the number 4 in cell B2 there are a number of ways to use this. with a variable Dim r As Range Set r = Range("B1") Range("B2").Value = r.Column with activecell range("c1").select Range("B2").Value = activecell.Column and there are others. hope this gets you started regards FSt1 "TWR" wrote: Is there an easy way to get the column number from the column letter in Excel 2002 VBA, similar to the worksheet function =COLUMN(B:B) which equal 2? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Best to follow-up at that post. It'll probably get overlooked in this one.
*********** Regards, Ron XL2003, WinXP "TWR" wrote: PS: I posted another question titled 'How to get Popup Text help to work' on 1/4. 12.25 AM PST. Chip Pearson answered part of my question about MSForms Controls and Windows handles for them but not actually about whether or not UserForms actually do not support What's This help. "Ron Coderre" wrote: Perhaps something like this: Range(strColEntered & "1").Column Where strColEntered is a variable containing the Column Letter entered by the user. Is that something you can work with? -------------------------- Regards, Ron Microsoft MVP (Excel) (XL2003, Win XP) "TWR" wrote in message ... Thanks, but I Don't want to write any data to the worksheet. I have a userform that asks in which column certain data is. The response will be the column letter. Thanks for the suggestion though. "FSt1" wrote: hi one way Range("B2").Value = Range("D1").Column which would produce the number 4 in cell B2 there are a number of ways to use this. with a variable Dim r As Range Set r = Range("B1") Range("B2").Value = r.Column with activecell range("c1").select Range("B2").Value = activecell.Column and there are others. hope this gets you started regards FSt1 "TWR" wrote: Is there an easy way to get the column number from the column letter in Excel 2002 VBA, similar to the worksheet function =COLUMN(B:B) which equal 2? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I turn excel columns from column number to column letter? | Setting up and Configuration of Excel | |||
Column Number from Column Letter | Excel Programming | |||
How to replace column letter in refferences with a function using the old column letter? | Excel Worksheet Functions | |||
Get Column Letter from Column Number | Excel Worksheet Functions | |||
column header changed from letter to number, how return to letter | Excel Discussion (Misc queries) |