Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default which page is active

How can I code an "if statement" to see which page in multipage form(4 pages)
has been selected? I want to do specific things if page4 is "active".
Thanks...
--
JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default which page is active

JT,

The Value property of the MultiPage control will return the index
number of the active tab. The index is zero-based, so the first
tab is Value = 0, the second page is Value = 1, etc. So you can
write code like

If Me.MultiPage1.Value = 3 Then
' fourth tab active
' do something
End If





--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"JT" wrote in message
...
How can I code an "if statement" to see which page in multipage
form(4 pages)
has been selected? I want to do specific things if page4 is
"active".
Thanks...
--
JT



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default which page is active

All you need is the index of the current page from the multipage value
property

Private Sub CommandButton1_Click()
Dim n As Long
Dim s As String

n = Me.MultiPage1.Value
s = Me.MultiPage1.Pages(n).Caption

MsgBox "Index " & n, , s

End Sub

Don't forget the index of the first page (Page1) is 0

Regards,
Peter T

"JT" wrote in message
...
How can I code an "if statement" to see which page in multipage form(4

pages)
has been selected? I want to do specific things if page4 is "active".
Thanks...
--
JT



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default which page is active

Option Explicit
Private Sub MultiPage1_Change()
Me.CommandButton1.Enabled = Not CBool(Me.MultiPage1.Value = 3)
Me.CommandButton2.Enabled = Not CBool(Me.MultiPage1.Value = 3)
End Sub

Almost stolen from a response to your other post.

JT wrote:

How can I code an "if statement" to see which page in multipage form(4 pages)
has been selected? I want to do specific things if page4 is "active".
Thanks...
--
JT


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default which page is active

Thanks for all of the help. I got it working now.... Thanks again
--
JT


"JT" wrote:

How can I code an "if statement" to see which page in multipage form(4 pages)
has been selected? I want to do specific things if page4 is "active".
Thanks...
--
JT

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
how do i insert page number on active cell? gendut Excel Discussion (Misc queries) 1 August 14th 08 04:18 AM
How to save a workbook to an active Web Page? Nadia Excel Discussion (Misc queries) 0 May 2nd 08 06:23 PM
Make excel the active page kaiser Excel Programming 2 October 8th 05 04:48 AM
Publish active sheet as static web page Stellina Excel Programming 2 August 2nd 05 07:54 PM
Can I set a page of a Multipage form to active? John T Ingato Excel Programming 2 October 11th 03 12:15 AM


All times are GMT +1. The time now is 02:43 AM.

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"