Hey all, Im kinda new to working with excel. I need to make a clickable button that when I click it it gives me a pre-determined text on another cell. Thanks for any help you can provide
Hey all, Im kinda new to working with excel. I need to make a clickable button that when I click it it gives me a pre-determined text on another cell. Thanks for any help you can provide
Make a button. By default is is called CommandButton1.
Double click and add line:![]()
Range("A1").Value = 3
![]()
Private Sub CommandButton1_Click() Range("A1").Value = 3 End Sub
Looking for great solutions but hate waiting?
Seach this Forum through Google
www.Google.com (e.g. +multiple +IF site:excelforum.com/excel-general/ )
www.Google.com (e.g. +fill +combobox site:excelforum.com/excel-programming/ )
Ave,
Ricardo
slmi,
Please read the Forum Rules about thread titles before starting your next thread.
Sorry about the title,
I also need to make that command button take some text that I will input on lets say A1 and copy past it on the text box that I have created in VB.
![]()
Private Sub CommandButton1_Click() Range("A1").Value = 3 TextBox1.Value = Range("A1") End Sub
when I enter the code above, I get the value 3 in the text box wich is great, but I also get the value 3 in the A1...what I need it to do is to take a text that I have already written in lets say sheet 3 A1 and put that info in the text box.
thanks for the help guys
![]()
TextBox1.Value = Worksheets("Sheet3").Range("A1")
thanks a lot that worked great, the only thing I forgot to mention is that I'm creating many command buttons, so I need the text to follow in the text box.
So when I click on the first command button it will type what ever is in the A1and put it in the text box then when I click command button2 it takes whatever is in A2 and put it in the text box after the A1, not removing what was already in there.
Thanks for all the help guys
thanks a lot that worked great, the only thing I forgot to mention is that I'm creating many command buttons, so I need the text to follow in the text box.
So when I click on the first command button it will type what ever is in the A1and put it in the text box then when I click command button2 it takes whatever is in A2 and put it in the text box after the A1, not removing what was already in there.
Thanks for all the help guys
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks