I have a list of file directories located on a second module using public const (I think this is a way to house the data?). On Module #1 I have a macro that has a prompt to enter text into an inputbox. Inside the inputbox I will be entering a name ie Andy. I would like to make a new variable that looks up Andy on the public const & defind that variable as the file directory for Andy. I am basically trying to automate saving an excel doc as a PDF to a specific folder base on the name I type into the inputbox. Can someone please help? Below are the macros I have now
Module #1
Sub PDF()
Dim MyInput As String
Dim Client As String
Dim Location As String
Dim Quarter As String
This_Year = Year(Now())
Report_Date = Right(Range("A4").Value, 10)
If Format(Report_Date, "mm/dd") = "03/31" Then
Report_Name = " 1Q " & This_Year & " Account Overview"
ElseIf Format(Report_Date, "mm/dd") = "06/30" Then
Report_Name = " 2Q " & This_Year & " Account Overview"
ElseIf Format(Report_Date, "mm/dd") = "09/30" Then
Report_Name = " 3Q " & This_Year & " Account Overview"
ElseIf Format(Report_Date, "mm/dd") = "12/31" Then
Report_Name = " 4Q " & This_Year & " Account Overview"
Else
Report_Name = "OD AO as of " & Report_Date
End If
MyInput = InputBox("Enter Client Last Name", _
"MyInputTitle", "Enter your input text HERE")
Client = MyInput
Location = 'need to be able to link what I type into the InputBox & a list of Public Consts on another module'
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, Filename:=Location & Client & Report_Name & ".pdf"
ActiveWorkbook.Close
End Sub
Module #2
Public Const Tim= "G:\Users\Tim\"
Public Const Bob = "G:\Users\Bob\"
Public Const Andy = "G:\Users\Andy\"
Bookmarks