Macro VBA

Posts
1
Registration date
Wednesday February 6, 2019
Status
Member
Last seen
February 6, 2019
- - Latest reply: ac3mark
Posts
12412
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
June 25, 2019
- Feb 6, 2019 at 10:57 AM
I have a macro that saves my file to a specific folder. However, when I save the file it adds in text that should not be there

Sub Save_FileName_BillTO_ShipTO()
Dim Path As String
Dim filename As String
Path = "C:\Users\kyla.henry\Brown\Business Intelligence - Documents\Reports\02_Customers"

filename = " " & "December" & " " & Range("B2") & " " & Range(" A2") & " Monthly Usage BT ST"


ActiveWorkbook.SaveAs filename:=Path & filename & ".xlsx", FileFormat:=xlNormal
End Sub


For instance it will add 02_Customers to the file name. How do I get rid of that?
See more 

1 reply

Best answer
Posts
12412
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
June 25, 2019
1084
1
Thank you
Alter your path variable and remove the last forward slash on....

Say "Thank you" 1

Glad we were able to help! Love us? Write us a review! Rate CCM

CCM 5074 users have said thank you to us this month

ac3mark
Posts
12412
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
June 25, 2019
1084 -
Alter the variable path. It is coded in the variable.
Respond to ac3mark