cancel
Showing results for 
Search instead for 
Did you mean: 

EXCEL VBO: Can we add parameters to the "Run macro" action?

Anonymous
Not applicable
2 REPLIES 2

HarikrishnaMura
Level 4
Hi There, I am not sure if this helps. You can create a new action to run the macro. Copy the same code as the original and update with the below. GetInstance(Handle).Run(Macro_Name, Parms1, Parms2, Parms3) Make sure you have Parms1, Parms2, Parms3 as inputs with data variables assigned. Please let us know if this worked

sarcher
Level 3
I can confirm the above. I created a new Macro function in my Excel workbook with the following code.. _____ Sub SelectCellReferenceOfValue(PlaceholderName As String) Dim ra As Range Set ra = Cells.Find(What:=PlaceholderName, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False) If ra Is Nothing Then MsgBox (""Not found"") Else ActiveSheet.Range(ra.Address).Select End If End Sub _______ Then added a code stage in my Excel VBO with the following Code snippet _______ GetInstance(Handle).Run(Macro_Name, Placeholder) _______ Where `Macro_Name` is ""SelectCellReferenceOfValue"" and `Placeholder` is the String data item value I'm searching for on the sheet.