LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default Toggle Button Caption

Hi Guys

I have the following code which hides/unhides rows, that I have assigned to
a button...

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False
Dim I As Long
Dim Hidden As Boolean

For I = 8 To 426
If Rows(I).EntireRow.Hidden Then
Hidden = True
Rows(I).EntireRow.Hidden = False
End If

Next I

If Hidden Then Exit Sub

For I = 8 To 426
If Cells(I, 2).Value < "TOTAL" Then
Range(Cells(I, 1), Cells(I, 1)).EntireRow.Hidden = True
End If
Next I
End Sub

.... how do I toggle the button caption so that when that only the TOTAL rows
are showing the caption is SHOW and else the caption is HIDE?

Thanks!
 
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
Adding .xla button for Toggle Calculation Button Mike Excel Programming 5 August 19th 05 01:55 PM
Toggle change control button face id & caption mikeburg[_2_] Excel Programming 1 June 25th 05 03:00 AM
Place the caption of a toggle button into a cell [email protected] Excel Worksheet Functions 2 May 12th 05 04:47 AM
Caption of a button Dr_Phil Excel Programming 4 May 4th 04 09:13 PM
Toggle custom button caption Tummy Excel Programming 4 February 23rd 04 07:40 PM


All times are GMT +1. The time now is 07:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"