needhelpplease
New Member
- Joined
- May 20, 2011
- Messages
- 4
I need to pass the value of a variable from one procedure to another without running the entire called procedure
Private Sub openReport(ByVal strProductFile as string)
MsgBox "Open previous week's report.", vbOKOnly + vbExclamation, "Open"
Application.Dialogs(xlDialogOpen).Show
strProductFile = Application.GetOpenFilename
End Sub
Public Sub vlookup()
Dim strProductFile as string
openReport strProductFile
...then I'll concatentate the name of the file with a vlookup formula
BUT
when I do it this way, it executes all of the openReport procedure...I only want the file name to be returned.
Private Sub openReport(ByVal strProductFile as string)
MsgBox "Open previous week's report.", vbOKOnly + vbExclamation, "Open"
Application.Dialogs(xlDialogOpen).Show
strProductFile = Application.GetOpenFilename
End Sub
Public Sub vlookup()
Dim strProductFile as string
openReport strProductFile
...then I'll concatentate the name of the file with a vlookup formula
BUT
when I do it this way, it executes all of the openReport procedure...I only want the file name to be returned.