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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
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,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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