Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default 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
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
Strange Page Break behaviour while AutoFilter enabled jaymz1102 Excel Discussion (Misc queries) 0 September 9th 08 01:40 PM
Multipage Pages will not show controls when enabled RyanH Excel Programming 7 July 1st 08 01:50 AM
MultiPage Page Order Sam Excel Programming 2 February 13th 08 06:01 PM
Delete Page of a MultiPage Geoff Excel Programming 3 November 15th 06 09:56 AM
how to put a reference from a page of a multipage form to another page Valeria[_2_] Excel Programming 2 January 25th 04 08:21 AM


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