Macro to save file with its current name but in a different, specified location

shivanikharbanda

New Member
Joined
Apr 21, 2015
Messages
4
Hey guys - struggling here.

I have a macro and I want to end it with saving the file in a specified location - not the current location where I am opening the file from. When I use this macro again, it will always need to be saved at that specified location. However, I want to save it as the name of the original file.

C :\ Resume

would then be in

J:\ Resume

Same name, different location. Let me know if I need to give more information...I'm new at this.

I appreciate any help I can get - thank you!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Do you want to turn the "C" into a "J" ?
Code:
    Dim Dr As String
    Dim Wnm As String
    Dim MyWB As String
    Application.DisplayAlerts = 0
    Dr = Replace(ThisWorkbook.Path, "C", "J") & "\"
    Wnm = ThisWorkbook.Name
    MyWB = Dr & Wnm
    ActiveWorkbook.SaveAs Filename:=MyWB
 
Upvote 0

Forum statistics

Threads
1,216,503
Messages
6,131,022
Members
449,616
Latest member
PsychoCube

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