Richhodg
New Member
- Joined
- Feb 28, 2023
- Messages
- 4
- Office Version
- 365
- 2021
- 2019
- 2016
- Platform
- Windows
I have created some vba code which i thought would work, but each time I run it I get a Compile error : Named argument not found, when using Formula1:
here is a copy of my code:
If I don't add the argument in, it brings up the blank popup box, so any help would be appreciated.
here is a copy of my code:
VBA Code:
Sub Insert_Profile()
' Declare variables
Dim MacroNames As Variant
Dim ChosenMacro As Variant
' Define the list of macro names
MacroNames = Array("X-Small", "Small", "Medium", "Large", "X-Large")
' Display the pop-up box with the macro names
ChosenMacro = Application.InputBox(Prompt:="Please select Profile Size", Title:="Profile Size List", Type:=8, Formula1:=Join(MacroNames, ","))
' Run the selected macro
Select Case ChosenMacro
Case "X-Small"
Workings_Insert_XS_Profile
Case "Small"
Workings_Insert_S_Profile
Case "Medium"
Workings_Insert_M_Profile
Case "Large"
Workings_Insert_L_Profile
Case "X-Large"
Workings_Insert_XL_Profile
Case Else
' Do nothing if no macro is selected or the selected macro does not exist
End Select
End Sub
If I don't add the argument in, it brings up the blank popup box, so any help would be appreciated.
Last edited by a moderator: