Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Multipage Buttons?

I apologize for my ignorance. I had posted before and I am able to change
the color of the buttons on a Multipage in an Excel Userform. My multiplage
is currently at 5 pages. However, I still cannot figure out how to make
changing the colors of the buttons when I select another button to open
another page. When I press the button it turns color but does not open the
page. When I click on another button I need the previous button to go back
to original color. I don't think I am doing this with the following code.
Can you please help.? Thank you

Private Sub MultiPage1_Change()
Dim cb1 As CommandButton
Set cb1 = Me.CommandButton52
If Me.MultiPage1.Pages(14).Caption = Visible = True Then
Me.MultiPage1.Pages(14).Caption = ""
Me.MultiPage1.Pages(0).Caption = Visible = False
Me.MultiPage1.Value = 1
cb1.BackColor = &HFFFF80
End If
Set cb1 = Me.CommandButton53
If Me.MultiPage1.Pages(15).Caption = Visible = True Then
Me.MultiPage1.Pages(15).Caption = ""
Me.MultiPage1.Pages(0).Caption = Visible = False
Me.MultiPage1.Value = 1
cb1.BackColor = &HFFFF80
End If
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Multipage Buttons?

I'm not sure what this means...

If Me.MultiPage1.Pages(14).Caption = Visible = True Then

as written it is the same as

If Me.MultiPage1.Pages(14).Caption = (Visible = True) Then

I suggest

If Me.MultiPage1.Value = 14 Then

Value returns the index of the active page


so you code could be re-written

Select case MultiPage.Value
Case 14
Set cb1 = Me.CommandButton52
Case 15
Set cb1 = Me.CommandButton53
Case Else
Set cb1 = Nothing
End Select
If not cb1 is nothing then
cb1.BackColor = &HFFFF80
Me.MultiPage1.Value = 1
End If






"TotallyConfused" wrote:

I apologize for my ignorance. I had posted before and I am able to change
the color of the buttons on a Multipage in an Excel Userform. My multiplage
is currently at 5 pages. However, I still cannot figure out how to make
changing the colors of the buttons when I select another button to open
another page. When I press the button it turns color but does not open the
page. When I click on another button I need the previous button to go back
to original color. I don't think I am doing this with the following code.
Can you please help.? Thank you

Private Sub MultiPage1_Change()
Dim cb1 As CommandButton
Set cb1 = Me.CommandButton52
If Me.MultiPage1.Pages(14).Caption = Visible = True Then
Me.MultiPage1.Pages(14).Caption = ""
Me.MultiPage1.Pages(0).Caption = Visible = False
Me.MultiPage1.Value = 1
cb1.BackColor = &HFFFF80
End If
Set cb1 = Me.CommandButton53
If Me.MultiPage1.Pages(15).Caption = Visible = True Then
Me.MultiPage1.Pages(15).Caption = ""
Me.MultiPage1.Pages(0).Caption = Visible = False
Me.MultiPage1.Value = 1
cb1.BackColor = &HFFFF80
End If
End Sub

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
Multipage Buttons?? TotallyConfused Excel Programming 6 October 3rd 09 07:24 PM
have toggle buttons but everytime print preview buttons move TinSandhu Excel Discussion (Misc queries) 1 October 11th 06 02:57 PM
multipage - option buttons disappear from frame in Excel 2003 j b corner Excel Programming 3 November 30th 05 04:20 AM
?? MultiPage Cancel/Next/Previous/Finish Command Buttons ?? [email protected] Excel Programming 3 May 27th 05 12:42 PM
Syntax Problem : Grouping Buttons On A Multipage [email protected] Excel Programming 2 May 27th 05 08:00 AM


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