Thread: Auto Saving
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Auto Saving

When you assign the value of the worksheet name to the variable string name,
concatenate the full path to the file

strName = "L:\Credit Management Team\Gareth Thomas\" & _
Worksheets("Sheet1").Range("C1").Value
--
Kevin Backmann


"GarToms" wrote:


Hi All,

I'v found this code to auto save my worksheet with the name in C1. I
want to specify the file to save it to. Does anyone know what code i
can put in it to save to the following directory
L:\Credit Management Team\Gareth Thomas


Sub SaveAsCell()
Dim strName As String

On Error GoTo InvalidName
strName = Sheet1.Range("C1")
ActiveWorkbook.SaveAs strName

Exit Sub
InvalidName: MsgBox "The text: " & strName & _
" is not a valid file name.", vbCritical, "Ozgrid.com"
End Sub


--
GarToms