macro challenge

msm205

New Member
Joined
Oct 12, 2002
Messages
34
I am trying to save a file to a specific directory, C:, with a file name contained in the cell A1. I thought this code was a start, but it's not working. Please help.

Public Sub SaveAsA1()
ThisFile = Range("A1").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
WorkbookName = Worksheets("Sheet1").Range("A1").Text
ActiveWorkbook.SaveAs Filename:= _
"C:" & WorkbookName & ".xls "
This message was edited by Asala42 on 2002-11-11 21:49
 
Upvote 0
Jack

Can I add the path to your formula ??

FileName = Range("A1").Value
ThisWorkbook.SaveAs FileName:=C:MT ReportsFileName

Would this work???
 
Upvote 0
Hi

Sorry for the delay

add this C:MT ReportsFileName into A1 and run the code - does that work, ive not tested as its 2am in London now SLEEP i get up at 6am for work, as you know i live on this site

PM or email if you get suck
jackintheuk@hotmail.com

HTH

JITUK
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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