Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i insert page number on active cell? | Excel Discussion (Misc queries) | |||
How to save a workbook to an active Web Page? | Excel Discussion (Misc queries) | |||
Make excel the active page | Excel Programming | |||
Publish active sheet as static web page | Excel Programming | |||
Can I set a page of a Multipage form to active? | Excel Programming |