How to save workbook in different folders depending on country code

Status
Not open for further replies.

hanz753

Board Regular
Joined
Aug 9, 2017
Messages
53
Hello,

I have the below code, I have nearly completed what I am trying to do. The final stage would be to save each workbook into different folders depending on the country code. Can you please help?




Private Sub filename_cellvalue()


Dim Path As String
Dim filename As String
Dim filename2 As String
'Dim country As String


Path = ""
filename = Range("A1")
filename2 = Range("B1")


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

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi hanz753,

The SaveAs can accept a string that would evaluate to a path. Simply change that string each time you want to save the workbook in a country folder.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top