View Single Post
  #3   Report Post  
lashio
 
Posts: n/a
Default

Hi, Dave
What do you call this?
Sub Manual_Input(Optional ans As Variant = "")
Is it a function?
It was not listed as macro; so, it can not be run independently.
Thanks

"Dave Peterson" wrote in message
...
Not that I know of. But if you can see the code for Manual_Input, maybe
you can
change it slightly:

Option Explicit
Sub Update_at_dayend()
Call Manual_Input(ans:="8.25%")
' I need a code something like "At prompt, answer = 8.25%"
End Sub

Sub Manual_Input(Optional ans As Variant = "")

If ans = "" Then
ans = InputBox(prompt:=" Enter Tax Rate for the area.")
End If

MsgBox ans
' the rest of the program
End Sub


And since the code is in the same workbook, I replaced Application.run
with a
simple Call.





lashio wrote:

Is there any VBA code for answering an InputBox Prompt of another macro.
e.g. running macro "Update_at_dayend"

Sub Update_at_dayend()
Application.Run "Manual_Input"
' I need a code something like "At prompt, answer = 8.25%"
End Sub

Sub Manual_Input()
Dim ans as variant
ans = InputBox(prompt:=" Enter Tax Rate for the area."
' the rest of the program
End Sub

Thanks


--

Dave Peterson