• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Convert problem

Ziguratx

New Member
Hey guys, i have i textbox inside useform, and will be putted a column letter, but in my code i want the number that correspond with that column letter. Ex : if someone type “b” in the textbox i want in my cose to show “2”
 
Hey, according to Excel Objects Model just use the Column property of the Range object like Range("B1").Column …​
 
I don't know how you grab the textbox contents, so I used a variable x and put a b in it, then to demonstrate the column number code I put the result into a variable y. You need to adapt the code.
It could be
x=textBox1.value
msgbox Cells(1,x).Column

or just:
msgbox Cells(1,textBox1.value).Column
 
I don't know how you grab the textbox contents, so I used a variable x and put a b in it, then to demonstrate the column number code I put the result into a variable y. You need to adapt the code.
It could be
x=textBox1.value
msgbox Cells(1,x).Column

or just:
msgbox Cells(1,textBox1.value).Column
Worked! Thanks man
 
Back
Top