Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
1.) How do you call a macro with Cell value arguments in a Command Button on
Sheet1 which passes Cell A1 value, not cell A1 reference. 'Target' argument must pass A1 value Problem is 'Target' passes back the cell reference not the value in the Cell. Example Public Sub Cmd_Services_Click(ByVal Target As CommandButton) ' A1 value is Supplies 'run code in Sheet1 ABC('Range("$A$1").Value) ???? End Sub 2.) In the properties window for command button, Name = Cmd_Services Should it be Name - Cmd_Services(A1) ? Cmd_Services(Sheet1!A1) ? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Try the below example Public Sub tESTER2(MyCell As Range) Dim rsp rsp = MsgBox(MyCell.Value, vbOKOnly) End Sub In the immediate window type your range in the call to the Sub e.g. tester2(Worksheets("Sheet4").cells(1,1)) -- Tony Green "Jeff" wrote: 1.) How do you call a macro with Cell value arguments in a Command Button on Sheet1 which passes Cell A1 value, not cell A1 reference. 'Target' argument must pass A1 value Problem is 'Target' passes back the cell reference not the value in the Cell. Example Public Sub Cmd_Services_Click(ByVal Target As CommandButton) ' A1 value is Supplies 'run code in Sheet1 ABC('Range("$A$1").Value) ???? End Sub 2.) In the properties window for command button, Name = Cmd_Services Should it be Name - Cmd_Services(A1) ? Cmd_Services(Sheet1!A1) ? . . I'm Frustrated -- Jeff :-) -- Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Call up build in excel command using macro | Excel Programming | |||
Custom button to call a macro in Personal | Excel Programming | |||
Call Userfor and click button with macro | Excel Programming | |||
call excel 2003 macro from command line | Excel Programming | |||
Button won't call macro | Excel Programming |