Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have TextBox1, CommandButton1 and CommandButton2. When user inputs a number
in TextBox1 and then clicks CommandButton1, I need that number sent to "Sheet4" Cell "B2" and a msgbox stating that "Whatever number was entered had been added to your Vacation". If CommandButton2 is selected UserForm closes. I understand I'm asking a lot! Thanks in advance for any help!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton1_Click()
Worksheets("Sheet4").Range("B2").Value = cdbl(Textbox1.Text) msgbox Textbox1.Text & " was added to your vacation" End sub Private Sub CommandButton2_Click() Unload Me End Sub if you want to add the number in the textbox to any value alreadyi n B2 it would be Private Sub CommandButton1_Click() With Worksheets("Sheet4") .Range("B2").Value = .Range("B2").Value + cdbl(Textbox1.Text) End With msgbox Textbox1.Text & " was added to your vacation" End sub If the number will be an integer, you can replace cdbl with clng -- Regards, Topm Ogilvy "Richard" wrote in message ... I have TextBox1, CommandButton1 and CommandButton2. When user inputs a number in TextBox1 and then clicks CommandButton1, I need that number sent to "Sheet4" Cell "B2" and a msgbox stating that "Whatever number was entered had been added to your Vacation". If CommandButton2 is selected UserForm closes. I understand I'm asking a lot! Thanks in advance for any help!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with UserForm Code | Excel Programming | |||
Creating a Userform using code | Excel Programming | |||
Userform Code | Excel Programming | |||
UserForm code help needed. | Excel Programming | |||
VBA code for Userform | Excel Programming |