Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 03:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"