Button text

patnitin

New Member
Joined
Mar 23, 2006
Messages
27
Hi,
I have some buttons in my worksheet which hide and unhide some of the columns on clicking it.I want the text to alternate between signs '+' and '-',based on whether its hiding/unhiding the columns.Inother words I want the button text to shw '+' sign when the columns are to be expanded and sign'-' when the columns are to be hidden.Such kind of application I have seen in many sheets but unable to do it my self.(kindly note the I have wrtten the code for the columns to be hidden/unhide and I want only the button text to change)

Can anybody help!
Thanks in advance.

Regards,
Nitin
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Have you tried the macro recorder? This is what it produces for me

Code:
ActiveSheet.Shapes("Button 1").Select
    Selection.Characters.Text = "Hello"
    With Selection.Characters(Start:=1, Length:=5).Font
        .Name = "NewsGoth BT"
        .FontStyle = "Roman"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
End Sub

Obviously, a lot of the erroneous code could be removed.
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,545
Members
449,317
Latest member
chingiloum

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top