Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multipage - If .Page(#).enabled Then
Hi !
I have a multipage with 5 pages. I want that: only when I select the page #4 ".page(3)" the routine is activated. It's something like: If Me.MultiPage1.Pages(3).Enabled = True Then Do the command... But it doesn't work, cause if I click on page 2, whatever, it starts the command anyway. I think that my mistake is in the syntax... Someone help me? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multipage - If .Page(#).enabled Then
Use the Change event...
Private Sub MultiPage1_Change() If MultiPage1.SelectedItem.Index = 2 Then End If End Sub OR If MultiPage1.SelectedItem.Caption = "Page2" Then End If If this post helps click Yes --------------- Jacob Skaria "Eddie_SP" wrote: Hi ! I have a multipage with 5 pages. I want that: only when I select the page #4 ".page(3)" the routine is activated. It's something like: If Me.MultiPage1.Pages(3).Enabled = True Then Do the command... But it doesn't work, cause if I click on page 2, whatever, it starts the command anyway. I think that my mistake is in the syntax... Someone help me? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multipage - If .Page(#).enabled Then
Hi Eddie,
Try this If Me.MultiPage1.Value = 3 Then MsgBox "Hola" 'or whatever code you have End If "Eddie_SP" wrote: Hi ! I have a multipage with 5 pages. I want that: only when I select the page #4 ".page(3)" the routine is activated. It's something like: If Me.MultiPage1.Pages(3).Enabled = True Then Do the command... But it doesn't work, cause if I click on page 2, whatever, it starts the command anyway. I think that my mistake is in the syntax... Someone help me? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multipage - If .Page(#).enabled Then
Jacob and Libby =)
Both worked perfectly !!! Thank yoooou !!! \o/ "Jacob Skaria" wrote: Use the Change event... Private Sub MultiPage1_Change() If MultiPage1.SelectedItem.Index = 2 Then End If End Sub OR If MultiPage1.SelectedItem.Caption = "Page2" Then End If If this post helps click Yes --------------- Jacob Skaria "Eddie_SP" wrote: Hi ! I have a multipage with 5 pages. I want that: only when I select the page #4 ".page(3)" the routine is activated. It's something like: If Me.MultiPage1.Pages(3).Enabled = True Then Do the command... But it doesn't work, cause if I click on page 2, whatever, it starts the command anyway. I think that my mistake is in the syntax... Someone help me? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multipage - If .Page(#).enabled Then
Now another thing...
When I select this page, the command is to open another file in a server here. How could I close this file if someone change the page? Something like: If Me.MultiPage1.Value < 3 Then ActiveWorkbook.Close False End If Thank you ! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multipage - If .Page(#).enabled Then
Hi Eddie,
Something like this perhaps Private Sub MultiPage1_Change() Dim myPath As String Dim myFname As String myPath = "C:\folder\" myFname = "Newbie.xls" Select Case Me.MultiPage1.Value Case 3 Workbooks.Open (myPath & myFname) Case Else On Error Resume Next Workbooks(myFname).Close savechanges:=false On Error GoTo 0 ' or you could loop through each open workbook End Select End Sub "Eddie_SP" wrote: Now another thing... When I select this page, the command is to open another file in a server here. How could I close this file if someone change the page? Something like: If Me.MultiPage1.Value < 3 Then ActiveWorkbook.Close False End If Thank you ! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Strange Page Break behaviour while AutoFilter enabled | Excel Discussion (Misc queries) | |||
Multipage Pages will not show controls when enabled | Excel Programming | |||
MultiPage Page Order | Excel Programming | |||
Delete Page of a MultiPage | Excel Programming | |||
how to put a reference from a page of a multipage form to another page | Excel Programming |