Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi All,
I'v found this code to auto save my worksheet with the name in C1. I want to specify the directory 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 I also want to change it to just save the 1 sheet in the workbook. 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 Last edited by GarToms : January 31st 06 at 12:55 PM |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#3
![]() |
|||
|
|||
![]()
excelent cheers
Quote:
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running auto correct on startup? | Excel Discussion (Misc queries) | |||
Averaging Values in Auto Filter | Excel Worksheet Functions | |||
Auto Update Linking and Saving | Excel Discussion (Misc queries) | |||
excel links update not working in auto, calculations in auto | Excel Worksheet Functions | |||
Why can't my macro use Auto Filter when I told the Sheet Protecti. | Excel Worksheet Functions |