View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dominicb[_51_] dominicb[_51_] is offline
external usenet poster
 
Posts: 1
Default command button()_click


Good morning Iamkeen

1. The way to do this is run an event procedure, where the code is
asking, if this cell = x then ... To do this you need to enclose your
code in this (as opposed to the usual Sub x() / End Sub constuct):

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
End Sub

and put it into the ThisWorkbook section of the VBE (see here for more
details http://www.cpearson.com/excel/events.htm)

2. You can't put a command button in a toolbar - only on a worksheet.
You can add another icon to a toolbar. Tools Customize and under
Toolbars selext Add. Once you have a new toolbar choose an icon under
the commands tab and drag it to your toolbar. Once it's there right
click and a drop down menu will appear with plenty of options. Among
the options will be to rename the button, edit the button (if you come
over all artistic!) or to assign a macro.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=384155