Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am new to userforms. I have a command button with caption of "Begin New
Order" which clears out form and places cursor in B1. I would like to have it also call up a userform. Below is the current code for the command button: Private Sub CommandButton2_Click() Range("B1:B3").Value = "" Range("D6:H8").ClearContents Range("A13:B90").ClearContents Range("C13:C90").Value = "" Range("B1").Select End Sub Below is the code for the userform: Public Sub Stationform() Dim station As String Dim crew As String Dim D As Date Dim st As New STINFO st.Show station = st.txtST.Value crew = st.txtCrew.Value D = st.txtDate.Value Range("B1").Value = station Range("B2").Value = crew Range("B3").Value = D End Sub How can I call up the userform within the execution of the commandbutton? Thanks, and Happy Thanksgiving. Les |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton2_Click()
Range("B1:B3").Value = "" Range("D6:H8").ClearContents Range("A13:B90").ClearContents Range("C13:C90").Value = "" Range("B1").Select StationForm End Sub Public Sub Stationform() Dim station As String Dim crew As String Dim D As Date Dim st As New STINFO st.Show station = st.txtST.Value crew = st.txtCrew.Value D = st.txtDate.Value Range("B1").Value = station Range("B2").Value = crew Range("B3").Value = D st.Show End Sub would be my guess. -- regards, Tom Ogilvy "WLMPilot" wrote: I am new to userforms. I have a command button with caption of "Begin New Order" which clears out form and places cursor in B1. I would like to have it also call up a userform. Below is the current code for the command button: Private Sub CommandButton2_Click() Range("B1:B3").Value = "" Range("D6:H8").ClearContents Range("A13:B90").ClearContents Range("C13:C90").Value = "" Range("B1").Select End Sub Below is the code for the userform: Public Sub Stationform() Dim station As String Dim crew As String Dim D As Date Dim st As New STINFO st.Show station = st.txtST.Value crew = st.txtCrew.Value D = st.txtDate.Value Range("B1").Value = station Range("B2").Value = crew Range("B3").Value = D End Sub How can I call up the userform within the execution of the commandbutton? Thanks, and Happy Thanksgiving. Les |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try,
UserForm1.Show or whatever the name of your user form is. Sandy WLMPilot wrote: I am new to userforms. I have a command button with caption of "Begin New Order" which clears out form and places cursor in B1. I would like to have it also call up a userform. Below is the current code for the command button: Private Sub CommandButton2_Click() Range("B1:B3").Value = "" Range("D6:H8").ClearContents Range("A13:B90").ClearContents Range("C13:C90").Value = "" Range("B1").Select End Sub Below is the code for the userform: Public Sub Stationform() Dim station As String Dim crew As String Dim D As Date Dim st As New STINFO st.Show station = st.txtST.Value crew = st.txtCrew.Value D = st.txtDate.Value Range("B1").Value = station Range("B2").Value = crew Range("B3").Value = D End Sub How can I call up the userform within the execution of the commandbutton? Thanks, and Happy Thanksgiving. Les |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Executing Macros | Excel Discussion (Misc queries) | |||
Forumlas Not Executing | Excel Discussion (Misc queries) | |||
executing an autofilter in VB | Excel Programming | |||
executing an add in | Excel Programming | |||
Code Changes Not Executing | Excel Programming |