![]() |
Executing Userform
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 |
Executing Userform
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 |
Executing Userform
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 |
All times are GMT +1. The time now is 02:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com