Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 210
Default same button on multiple pages

Hi
I have a multipage form and I would like to know if it's possible to link
the "on click" code to similar buttons on the different pages. For example,
on each form, I have a NEXT button which takes you to the next page. I would
like to know if the same code can be assigned to each NEXT button, instead of
having many different CommandButtonxx_click codes. It would be great to just
refer each button to say a cbNext_click() code.
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default same button on multiple pages

You need to have one macro for each button. but you can combine the code if
you are smart

Private Sub CommandButton1_Click()
call Commonbutton()
End Sub

Private Sub CommandButton1_Click()
call Commonbutton()

End Sub

Private Sub CommandButton1_Click()
call Commonbutton()

End Sub

'put into a module
Sub Commonbutton()

'put common code here
exit Sub


"Robin" wrote:

Hi
I have a multipage form and I would like to know if it's possible to link
the "on click" code to similar buttons on the different pages. For example,
on each form, I have a NEXT button which takes you to the next page. I would
like to know if the same code can be assigned to each NEXT button, instead of
having many different CommandButtonxx_click codes. It would be great to just
refer each button to say a cbNext_click() code.
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default same button on multiple pages

On most of these type wizards, the back and next buttons are outside of the
multipage control. (Look at how the data|text to columns wizard is laid out.)



Robin wrote:

Hi
I have a multipage form and I would like to know if it's possible to link
the "on click" code to similar buttons on the different pages. For example,
on each form, I have a NEXT button which takes you to the next page. I would
like to know if the same code can be assigned to each NEXT button, instead of
having many different CommandButtonxx_click codes. It would be great to just
refer each button to say a cbNext_click() code.
Thanks!


--

Dave Peterson
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
why does tab button jump pages in Excel instead of cells? Lori Excel Discussion (Misc queries) 1 November 6th 09 05:52 PM
when opening excell a Insert Visio Button pages opensHow 2 stopit Insert Visio Button Removal Setting up and Configuration of Excel 0 December 17th 07 05:39 PM
Multiple Pages Dave Excel Discussion (Misc queries) 2 July 3rd 07 11:56 AM
multiple pages for multiple users fourskunks Excel Discussion (Misc queries) 1 September 9th 05 07:29 PM
multiple pages Grace[_3_] Excel Programming 0 September 19th 04 05:43 PM


All times are GMT +1. The time now is 03:24 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"