Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing Macros bmorganh Excel Discussion (Misc queries) 1 January 27th 06 12:03 AM
Forumlas Not Executing Trey Excel Discussion (Misc queries) 2 January 25th 06 04:02 PM
executing an autofilter in VB [email protected] Excel Programming 3 November 15th 05 01:36 PM
executing an add in Gary Keramidas Excel Programming 6 November 6th 05 09:56 PM
Code Changes Not Executing Justin[_8_] Excel Programming 1 October 24th 03 02:31 AM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"