Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Pressing a CommandButton on a Userform via Code

I want to have a user click a Commandbutton on Userform5 that will Show
Userform8.
This is OK,
Userform8 has a CommandButton1 to View a Sheet in PrintPreview.
How can i get the Userform8 CommandButton to to Coded to Run to the Preview
with out having to press it ?


I tried:
Call Userform8.Commandbutton1 but get an error
also tried:

Call CommandButton1 but still get an error.

How can this be done?
Corey....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Pressing a CommandButton on a Userform via Code

Corey,
CommandButton1.Value = True

NickHK

"Corey" wrote in message
...
I want to have a user click a Commandbutton on Userform5 that will Show
Userform8.
This is OK,
Userform8 has a CommandButton1 to View a Sheet in PrintPreview.
How can i get the Userform8 CommandButton to to Coded to Run to the

Preview
with out having to press it ?


I tried:
Call Userform8.Commandbutton1 but get an error
also tried:

Call CommandButton1 but still get an error.

How can this be done?
Corey....




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Pressing a CommandButton on a Userform via Code

Hmm.
Still a bit puzzled.

So how would I :
Using Commandbutton3 on Userform5 i copied the code that i normally use to
unload the uersorm data into a sheet.
i want to add at the end of this code the following:
Userform4.Show & use the value that was in Userform5.Textbox195 as the
selected value in Userform4.Combobox1.value,
then Press the CommandButton1 of Userform4(CommandButton1.Value = True),
then
this Button inputs data from the sheet that Userform5 also add data to,
thendisplays a 1 page sheet with the data placed in the relative cells in
Print Preview mode.

I am having trouble carrying the value from Userform5 through to Userform4,
and getting each of the Userforms no longer require to Close off correctly.

Any idea's of the most efective way to do this?

I tried copying ALL code into the CommandButton3 code on Userform5 but it
took forever and stalled at stages with errors.

Corey....



"Corey" wrote in message
...
I want to have a user click a Commandbutton on Userform5 that will Show
Userform8.
This is OK,
Userform8 has a CommandButton1 to View a Sheet in PrintPreview.
How can i get the Userform8 CommandButton to to Coded to Run to the
Preview with out having to press it ?


I tried:
Call Userform8.Commandbutton1 but get an error
also tried:

Call CommandButton1 but still get an error.

How can this be done?
Corey....



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Pressing a CommandButton on a Userform via Code

Corey,
Not sure about everything you're after, but....

with Userform4
.load 'but not show yet
.Combobox1.value=userform5.textbox195.text
userform5.hide
'or
unload userform5
.show 'vbmodal or vbmodeless
end with

NickHK

"Corey" wrote in message
...
Hmm.
Still a bit puzzled.

So how would I :
Using Commandbutton3 on Userform5 i copied the code that i normally use

to
unload the uersorm data into a sheet.
i want to add at the end of this code the following:
Userform4.Show & use the value that was in Userform5.Textbox195 as the
selected value in Userform4.Combobox1.value,
then Press the CommandButton1 of Userform4(CommandButton1.Value = True),
then
this Button inputs data from the sheet that Userform5 also add data to,
thendisplays a 1 page sheet with the data placed in the relative cells in
Print Preview mode.

I am having trouble carrying the value from Userform5 through to

Userform4,
and getting each of the Userforms no longer require to Close off

correctly.

Any idea's of the most efective way to do this?

I tried copying ALL code into the CommandButton3 code on Userform5 but it
took forever and stalled at stages with errors.

Corey....



"Corey" wrote in message
...
I want to have a user click a Commandbutton on Userform5 that will Show
Userform8.
This is OK,
Userform8 has a CommandButton1 to View a Sheet in PrintPreview.
How can i get the Userform8 CommandButton to to Coded to Run to the
Preview with out having to press it ?


I tried:
Call Userform8.Commandbutton1 but get an error
also tried:

Call CommandButton1 but still get an error.

How can this be done?
Corey....





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Pressing a CommandButton on a Userform via Code

What does this do:
'vbmodal or vbmodeless

??
"NickHK" wrote in message
...
Corey,
Not sure about everything you're after, but....

with Userform4
.load 'but not show yet
.Combobox1.value=userform5.textbox195.text
userform5.hide
'or
unload userform5
.show 'vbmodal or vbmodeless
end with

NickHK

"Corey" wrote in message
...
Hmm.
Still a bit puzzled.

So how would I :
Using Commandbutton3 on Userform5 i copied the code that i normally use

to
unload the uersorm data into a sheet.
i want to add at the end of this code the following:
Userform4.Show & use the value that was in Userform5.Textbox195 as the
selected value in Userform4.Combobox1.value,
then Press the CommandButton1 of Userform4(CommandButton1.Value = True),
then
this Button inputs data from the sheet that Userform5 also add data to,
thendisplays a 1 page sheet with the data placed in the relative cells in
Print Preview mode.

I am having trouble carrying the value from Userform5 through to

Userform4,
and getting each of the Userforms no longer require to Close off

correctly.

Any idea's of the most efective way to do this?

I tried copying ALL code into the CommandButton3 code on Userform5 but it
took forever and stalled at stages with errors.

Corey....



"Corey" wrote in message
...
I want to have a user click a Commandbutton on Userform5 that will Show
Userform8.
This is OK,
Userform8 has a CommandButton1 to View a Sheet in PrintPreview.
How can i get the Userform8 CommandButton to to Coded to Run to the
Preview with out having to press it ?


I tried:
Call Userform8.Commandbutton1 but get an error
also tried:

Call CommandButton1 but still get an error.

How can this be done?
Corey....









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Pressing a CommandButton on a Userform via Code

What does this do:
'vbmodal or vbmodeless


It indicates that either the vbModal or the vbModeless constant value should
be provided to the Show command. With vbModal, you can interact only with
the form until the form is hidden or unloaded. You can't access anything
outside the form, and code execution pauses on the Show statement until the
form is dismissed. With vbModeless, the form is shown and execution proceeds
past the Show statement. With a modeless form, you can interact with the
Excel environment while the form is still visible. If neither vbModal or
vbModeless parameter is omitted the form is show modal unless the ShowModal
property is set to False.



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Corey" wrote in message
...
What does this do:
'vbmodal or vbmodeless

??
"NickHK" wrote in message
...
Corey,
Not sure about everything you're after, but....

with Userform4
.load 'but not show yet
.Combobox1.value=userform5.textbox195.text
userform5.hide
'or
unload userform5
.show 'vbmodal or vbmodeless
end with

NickHK

"Corey" wrote in message
...
Hmm.
Still a bit puzzled.

So how would I :
Using Commandbutton3 on Userform5 i copied the code that i normally use

to
unload the uersorm data into a sheet.
i want to add at the end of this code the following:
Userform4.Show & use the value that was in Userform5.Textbox195 as the
selected value in Userform4.Combobox1.value,
then Press the CommandButton1 of Userform4(CommandButton1.Value = True),
then
this Button inputs data from the sheet that Userform5 also add data to,
thendisplays a 1 page sheet with the data placed in the relative cells
in
Print Preview mode.

I am having trouble carrying the value from Userform5 through to

Userform4,
and getting each of the Userforms no longer require to Close off

correctly.

Any idea's of the most efective way to do this?

I tried copying ALL code into the CommandButton3 code on Userform5 but
it
took forever and stalled at stages with errors.

Corey....



"Corey" wrote in message
...
I want to have a user click a Commandbutton on Userform5 that will
Show
Userform8.
This is OK,
Userform8 has a CommandButton1 to View a Sheet in PrintPreview.
How can i get the Userform8 CommandButton to to Coded to Run to the
Preview with out having to press it ?


I tried:
Call Userform8.Commandbutton1 but get an error
also tried:

Call CommandButton1 but still get an error.

How can this be done?
Corey....









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
play sound when pressing commandbutton Hoyos Excel Discussion (Misc queries) 1 August 19th 07 04:12 PM
Hiding A TextBox On A UserForm Under A CommandButton Minitman[_4_] Excel Programming 5 August 26th 05 09:56 PM
CommandButton - Userform Marcia3641 Excel Discussion (Misc queries) 2 July 21st 05 06:39 PM
Combobox with Commandbutton in Userform! Stift[_16_] Excel Programming 7 May 28th 04 08:50 AM
Commandbutton in UserForm to run Macro salihyil[_4_] Excel Programming 2 February 16th 04 05:36 PM


All times are GMT +1. The time now is 04:06 PM.

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

About Us

"It's about Microsoft Excel"