command button question?

G

Guest

I am using the following script to hide and open specific columns after the
command button is clicked. I have also made other command buttons inside of
the hidden columns invisible.

My problem is the following. I also want the command button that i have
selected to perform this function to become invisible after its function has
been performed.

My current script opens and closes columns appropriatley and makes all
command buttons selected invisible except for the command button that is
being used. The command button being used moves over into the columns that
are open. If i highlight over the command button that moves over.. it will
dissappear.

any suggestions on how to make this button being used become invisible?

**************************************************
Private Sub primaryformentryoption_Click()

ActiveSheet.Shapes("primaryangagramimport").Visible = False
ActiveSheet.Shapes("primaryblankimport").Visible = False
ActiveSheet.Shapes("primaryanagramhelp").Visible = False
ActiveSheet.Shapes("primaryformentryoption").Visible = False
ActiveSheet.Shapes("primaryanagramcomplete").Visible = False

ActiveSheet.Shapes("primaryformhelp").Visible = True
ActiveSheet.Shapes("primaryanagramentryoption").Visible = True
ActiveSheet.Shapes("primaryformcomplete").Visible = True

Range("aw11:ca11").Select
Selection.EntireColumn.Hidden = False

Range("a11:at11").Select
Selection.EntireColumn.Hidden = True

Range("a1").Select


End Sub
 
T

Tom Ogilvy

Private Sub primaryformentryoption_Click()

Application.ScreenUpdating = False

ActiveSheet.Shapes("primaryangagramimport").Visible = False
ActiveSheet.Shapes("primaryblankimport").Visible = False
ActiveSheet.Shapes("primaryanagramhelp").Visible = False
ActiveSheet.Shapes("primaryformentryoption").Visible = False
ActiveSheet.Shapes("primaryanagramcomplete").Visible = False

ActiveSheet.Shapes("primaryformhelp").Visible = True
ActiveSheet.Shapes("primaryanagramentryoption").Visible = True
ActiveSheet.Shapes("primaryformcomplete").Visible = True


Range("aw11:ca11").Select
Selection.EntireColumn.Hidden = False

Range("a11:at11").Select
Selection.EntireColumn.Hidden = True


Range("a1").Select

Doevents
Application.ScreenUpdating = True

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top