Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Buttons Embedded in a Worksheet

OK - I know - This is probably a basic questions for you experts, but I would
like to know how to add buttons to a worksheet that hide and unhide specific
colums, and how these commands/buttons are created.

I have inherited a workbook that someone else created, and now I need to add
more data to it in the same manner as the original author.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Buttons Embedded in a Worksheet

Bring up the Control Toolbox toolbar (Tools - Customize - Toolbars -
Control Toolbox). Click on the Button icon and then click on the worksheet to
place one on your sheet. Right click the button and select Properties. Change
the Caption to something like Hide/Unhide. Double click on the button. This
will take you to the code window. Add something like the following the the
code that was added for you...

Private Sub CommandButton1_Click()
Columns("B:C").Hidden = Not Columns("B:C").Hidden
End Sub
--
HTH...

Jim Thomlinson


"Wendy" wrote:

OK - I know - This is probably a basic questions for you experts, but I would
like to know how to add buttons to a worksheet that hide and unhide specific
colums, and how these commands/buttons are created.

I have inherited a workbook that someone else created, and now I need to add
more data to it in the same manner as the original author.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Buttons Embedded in a Worksheet

Thanks Jim -
I have the button, and I pasted your code.
Now what? How do I save it, and make it work?



"Jim Thomlinson" wrote:

Bring up the Control Toolbox toolbar (Tools - Customize - Toolbars -
Control Toolbox). Click on the Button icon and then click on the worksheet to
place one on your sheet. Right click the button and select Properties. Change
the Caption to something like Hide/Unhide. Double click on the button. This
will take you to the code window. Add something like the following the the
code that was added for you...

Private Sub CommandButton1_Click()
Columns("B:C").Hidden = Not Columns("B:C").Hidden
End Sub
--
HTH...

Jim Thomlinson


"Wendy" wrote:

OK - I know - This is probably a basic questions for you experts, but I would
like to know how to add buttons to a worksheet that hide and unhide specific
colums, and how these commands/buttons are created.

I have inherited a workbook that someone else created, and now I need to add
more data to it in the same manner as the original author.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Buttons Embedded in a Worksheet

You are probably still in design mode. There is a little triangle / ruler
icon on the Control Toolbox toolbar. Click it to exit design mode. You should
now be able to click the button to hide or unhide the columns...
--
HTH...

Jim Thomlinson


"Wendy" wrote:

Thanks Jim -
I have the button, and I pasted your code.
Now what? How do I save it, and make it work?



"Jim Thomlinson" wrote:

Bring up the Control Toolbox toolbar (Tools - Customize - Toolbars -
Control Toolbox). Click on the Button icon and then click on the worksheet to
place one on your sheet. Right click the button and select Properties. Change
the Caption to something like Hide/Unhide. Double click on the button. This
will take you to the code window. Add something like the following the the
code that was added for you...

Private Sub CommandButton1_Click()
Columns("B:C").Hidden = Not Columns("B:C").Hidden
End Sub
--
HTH...

Jim Thomlinson


"Wendy" wrote:

OK - I know - This is probably a basic questions for you experts, but I would
like to know how to add buttons to a worksheet that hide and unhide specific
colums, and how these commands/buttons are created.

I have inherited a workbook that someone else created, and now I need to add
more data to it in the same manner as the original author.


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
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Programming 2 August 24th 06 05:26 PM
Excel VBA moving embedded command buttons jgcuk Excel Programming 0 June 29th 04 05:41 PM
Excel VBA moving embedded command buttons jgcuk[_2_] Excel Programming 0 June 29th 04 05:34 PM
Visibility Problem of Embedded Buttons in Worksheet Dave Peterson[_3_] Excel Programming 2 June 10th 04 03:39 AM
Embedded option buttons Jerett Excel Programming 0 December 31st 03 04:04 PM


All times are GMT +1. The time now is 11:34 PM.

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"