Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Command Button

Is there a method of making a command butoon visible on all worksheets
without creating a new object on each sheet? I've put it in a userform, but
then I cannot navigate between sheets without closing the form.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Command Button

Why not create the same object on each sheet??:

Sub Macro2()
For Each sh In Worksheets
sh.Activate
ActiveSheet.Buttons.Add(248.25, 75.75, 90.75, 51).Select
Selection.OnAction = "hello"
Range("A1").Select
Next
End Sub

The usual way is to put the button on a toolbar.
--
Gary''s Student - gsnu200782


"NJD" wrote:

Is there a method of making a command butoon visible on all worksheets
without creating a new object on each sheet? I've put it in a userform, but
then I cannot navigate between sheets without closing the form.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Command Button

hi
if you have to close the form to navigate sheet, your from is modal, meaning
that the form has focus untll closed. you need to make the form modaless. how.
you probable have a sub that shows the form, maybe something like this.
Sub mac1ShoCal()
Load frmCalendar
frmCalendar.Show
end sub

modal = t and is default
modalless = false
to make the form modaless place a zero(false) after the show command as in
the above example.....

frmCalendar.Show 0

look up the showmodal property in vb help.

Regards
FSt1
"NJD" wrote:

Is there a method of making a command butoon visible on all worksheets
without creating a new object on each sheet? I've put it in a userform, but
then I cannot navigate between sheets without closing the form.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Command Button

New sheets will be added to the file regularly which makes adding a button to
each worksheet as the sheets are added more complicated than most of the
folks using hte file can handle.. Settign the form modal to 0 will suffice.


"FSt1" wrote:

hi
if you have to close the form to navigate sheet, your from is modal, meaning
that the form has focus untll closed. you need to make the form modaless. how.
you probable have a sub that shows the form, maybe something like this.
Sub mac1ShoCal()
Load frmCalendar
frmCalendar.Show
end sub

modal = t and is default
modalless = false
to make the form modaless place a zero(false) after the show command as in
the above example.....

frmCalendar.Show 0

look up the showmodal property in vb help.

Regards
FSt1
"NJD" wrote:

Is there a method of making a command butoon visible on all worksheets
without creating a new object on each sheet? I've put it in a userform, but
then I cannot navigate between sheets without closing the form.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Command Button

You can't have the same button on more than one sheet. You could put it on a
UserForm and show the form modelessly. Then, the form will be visible but
you can navigate between sheets. The form will just float there, waiting to
be clicked.

UserForm1.Show vbModeless '<< must include vbModeless to the Show method


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"NJD" wrote in message
...
Is there a method of making a command butoon visible on all worksheets
without creating a new object on each sheet? I've put it in a userform,
but
then I cannot navigate between sheets without closing the form.


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
Wanting to Create A Command Button Command bumper338 Excel Programming 3 May 7th 07 06:53 PM
VB's Command Button vs Form's Command Button Ronald Dodge Excel Programming 3 May 24th 06 02:23 PM
Command Button vs Form Button Bri[_3_] Excel Programming 2 February 3rd 06 08:18 AM
Command Button vs Control Button RGibson Excel Programming 1 October 14th 03 02:24 AM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM


All times are GMT +1. The time now is 06:14 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"