on ‎2016 Dec 05 1:45 PM
Hi Experts,
I would like to run a Macro after submitting data on an input form.
I need to link the macro/VBA to the submit/refresh event. Having issues with linking the macro. Macro itself works fine.
The functionality is to indicate that a field has been filled – user selects from a drop down marked in Green. The drop down deletes the existing VLOOKUP and the macro re-pastes the existing VLOOKUP after submission.

First tried inserting:
AFTER_EXPAND = True
End Function
Function AFTER_SEND(Argument As String)
But I am missing correct script – Don't understand what is expected "Argument As String", the macro does not run.
Sub InsertDropDownBoxTextOption()
'
' InsertDropDownBoxTextOption Macro
' Insert the Incomplete or N/A description to the dropdown boxes after Refresh
AFTER_REFRESH (True)
'
Application.GoTo Referene: ="R115C117"
Range("Q115").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q118").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q121").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q124").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q127").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q129").Select
End Sub
See Below.
2) Alternate plan - tried to add the script after a a refresh/submit using the EVMNU options script as
Below.
Now the Macro is supposed to present the Send and Refresh Schedule box, but I receive errors on the bold lines below. These were copied from another report that works fine.
Any
ideas as to how to correct?
Working with 7.5 MS SP11 and Excel 2007 and Excel 2010 Standard.
Sub CmdBtRefresh_Click()
TxtBxRefresh.Text = "Loading..."
CmdBtRefresh.Visible = False
Run ([MNU_ESUBMIT_CURRENT])
TxtBxRefresh.Text = "Expand & Refresh"
CmdBtRefresh.Visible = True
Call InsetTextForDropDown
End Sub
Sub InsetTextForDropDown()
'
' InsetTextForDropDown Macro
'
Application.Goto Reference:="R115C17"
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q115").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q118").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q121").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q124").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q127").Select
ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"
Range("Q127").Select
End Sub
Any ideas to make this work?
Regards,
Eyal
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi Vadim,
Using 7.5 MS version. Should have been the link to the MS help.
Thanks
Eyal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 32 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.