View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jeff Jeff is offline
external usenet poster
 
Posts: 921
Default call a macro with arguments in a Command Button

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) ?