![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
Can anyone help? If i have a userform with a multipage in it, and on the first page of the multipage i have a button, can i get the button (when clikced) to activate and goto the second page of the multipage?
i really need to know, thanks [ This Message was edited by: willlobb on 2002-03-31 09:11 ] [ This Message was edited by: willlobb on 2002-03-31 09:28 ] |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
You could try the following (Value can be from 0 to 1 less than the number of pages you have in your multipage):-
Private Sub CommandButton1_Click() MultiPage1.Value = 1 End Sub Not sure why you'd want to do this though? |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
Thanks MudFace,
that worked, now is there anyway of getting it to go to the next page? ie page x. would it be possible to use the CStr thingy? by the way, im making a financial system for my young enterprise company and i have a user form where you enter the no. of hours each employee has worked. each person is on a separate page of a multipage, so when you enter the first persons hours i want it to goto the next person automatically (if any of that makes sense!) thanks Will |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
OK, the following will advance you through the pages one by one, then loop back to the first page when you reach the end: -
Private Sub CommandButton1_Click() If MultiPage1.Pages.Count - 1 > MultiPage1.Value Then MultiPage1.Value = MultiPage1.Value + 1 Else: MultiPage1.Value = 0 End If End Sub |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
Thanks alot.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|