From: totally lost on 6 Apr 2010 16:46 Hi, how do I get this to save the file to specific location, it just keeps going to my documents. Public Sub SaveAsE5() ThisFile = Range("E5").Value ActiveWorkbook.SaveAs Filename:=ThisFile End Sub
From: Dave Peterson on 6 Apr 2010 16:57 Option Explicit Public Sub SaveAsE5() Dim ThisFile as string Dim myPath as string myPath = "C:\your path here" if right(mypath,1) <> "\" then mypath = mypath & "\" end if ThisFile = Activesheet.Range("E5").Value ActiveWorkbook.SaveAs Filename:=mypath & ThisFile End Sub totally lost wrote: > > Hi, > how do I get this to save the file to specific location, it just keeps going > to my documents. > > Public Sub SaveAsE5() > ThisFile = Range("E5").Value > ActiveWorkbook.SaveAs Filename:=ThisFile > End Sub -- Dave Peterson
From: Jim Thomlinson on 6 Apr 2010 17:02 Define Specific Location. You could put the full path and file name in the cell. You could hard code a path in the procedule like this... Public Sub SaveAsE5() thisWorkbook.SaveAs C:\WhereEver\ & Sheets("Sheet1").Range("E5").Value End Sub or in the same directory as the existing workbook Public Sub SaveAsE5() with thisWorkbook .SaveAs .path & "\" & Sheets("Sheet1").Range("E5").Value end with End Sub -- HTH... Jim Thomlinson "totally lost" wrote: > Hi, > how do I get this to save the file to specific location, it just keeps going > to my documents. > > Public Sub SaveAsE5() > ThisFile = Range("E5").Value > ActiveWorkbook.SaveAs Filename:=ThisFile > End Sub >
|
Pages: 1 Prev: How to records that the date field = todays date in VBA Next: Showing Outline Symbols |