Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Help with a macro
I'm using Excel 2003. I am working in a master worksheet named "SHPG
RCVG RPT" which is on my desktop. After I enter all of the information and create my hyperlinks, I need to protect the worksheet and then save it to a different folder. The new name of the worksheet is determined by the purchase order # which is in cell D3. I need a macro which will: Protect the worksheet -- Name the worksheet using the purchase order # in D3 --Save the worksheet in: F:\SHIPPING RECEIVING REPORT. I can't do this using the macro recorder because it won't let me click on the cell in order to name it when saving. It seems like it has to be written in VBasic, but I don't know the code. I know it's probably very simple, but I don't know how to do it. Is there anybody who can help? Thank you Daryl |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Help with a macro
This should help with renaming the file. Sub SaveClose() ' Saves file with current week in file name and closes file. Dim StrFirst As String With Worksheets("Sheet") ' this is the sheet your PO # is on StrFirst = .Range("D5") ' this is the cell your PO # is in End With Application.DisplayAlerts = False ActiveWorkbook.SaveAs _ "F:\Shipping Receiving Report\" & "MySheet_" & StrFirst, xlWorkbookNormal ' this will name the file "MySheet_0123.xls" (0123 being PO#) " wrote: I'm using Excel 2003. I am working in a master worksheet named "SHPG RCVG RPT" which is on my desktop. After I enter all of the information and create my hyperlinks, I need to protect the worksheet and then save it to a different folder. The new name of the worksheet is determined by the purchase order # which is in cell D3. I need a macro which will: Protect the worksheet -- Name the worksheet using the purchase order # in D3 --Save the worksheet in: F:\SHIPPING RECEIVING REPORT. I can't do this using the macro recorder because it won't let me click on the cell in order to name it when saving. It seems like it has to be written in VBasic, but I don't know the code. I know it's probably very simple, but I don't know how to do it. Is there anybody who can help? Thank you Daryl |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |