A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Button availability



 
 
Thread Tools Display Modes
  #1  
Old December 11th, 2008, 01:58 PM posted to microsoft.public.excel.misc
Jeff Parrott
external usenet poster
 
Posts: 3
Default Button availability

I have several macros in a workbook and I want to assign them to buttons to
make it easier for new people to use the workbook. However I commonly am
required to add new worksheets and would like the buttons to be available on
the new sheets. Is there any way to make the buttons available on all
worksheets without the need to locate them on a worksheet dedicated for that
sole purpose?
--
Whether you think you can or cannot, you are right. - Henry Ford
  #2  
Old December 11th, 2008, 02:12 PM posted to microsoft.public.excel.misc
Jarek Kujawa[_2_]
external usenet poster
 
Posts: 775
Default Button availability

go to ALT+F11, Project - VBA Project tab
click on ThisWorkbook

and put the following code there

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If ActiveSheet.Name "Sheet1" Then
Sheets("Sheet1").Shapes("Button 2").Copy
ActiveSheet.Paste
End If
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If ActiveSheet.Name "Sheet1" Then
For Each Shape In ActiveSheet.Shapes
Shape.Delete
Next
End If
End Sub

HIH


On 11 Gru, 14:58, Jeff Parrott
wrote:
I have several macros in a workbook and I want to assign them to buttons to
make it easier for new people to use the workbook. However I commonly am
required to add new worksheets and would like the buttons to be available on
the new sheets. Is there any way to make the buttons available on all
worksheets without the need to locate them on a worksheet dedicated for that
sole purpose?
--
Whether you think you can or cannot, you are right. - Henry Ford


  #3  
Old December 11th, 2008, 02:21 PM posted to microsoft.public.excel.misc
Gary''s Student
external usenet poster
 
Posts: 7,584
Default Button availability

Rather than put the buttons on a worksheet, put them on a custom toolbar that
you dock up top with the other standard toolbars.

Use the Open event macro to display this custom toolbar.
--
Gary''s Student - gsnu200819


"Jeff Parrott" wrote:

I have several macros in a workbook and I want to assign them to buttons to
make it easier for new people to use the workbook. However I commonly am
required to add new worksheets and would like the buttons to be available on
the new sheets. Is there any way to make the buttons available on all
worksheets without the need to locate them on a worksheet dedicated for that
sole purpose?
--
Whether you think you can or cannot, you are right. - Henry Ford

  #4  
Old December 11th, 2008, 04:13 PM posted to microsoft.public.excel.misc
Jeff Parrott
external usenet poster
 
Posts: 3
Default Button availability

Great idea, I hadn't thought of that. Thanks!
--
Whether you think you can or cannot, you are right. - Henry Ford


"Gary''s Student" wrote:

Rather than put the buttons on a worksheet, put them on a custom toolbar that
you dock up top with the other standard toolbars.

Use the Open event macro to display this custom toolbar.
--
Gary''s Student - gsnu200819


"Jeff Parrott" wrote:

I have several macros in a workbook and I want to assign them to buttons to
make it easier for new people to use the workbook. However I commonly am
required to add new worksheets and would like the buttons to be available on
the new sheets. Is there any way to make the buttons available on all
worksheets without the need to locate them on a worksheet dedicated for that
sole purpose?
--
Whether you think you can or cannot, you are right. - Henry Ford

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.