Consulting

Results 1 to 2 of 2

Thread: Save by Cell Value

  1. #1

    Save by Cell Value

    Good evening
    I am using Office 2003 and Windows XP. I have a workbook with the following recorded macro:-

    Sub SAVEANDEND()
    '
    ' SAVEANDEND Macro
    ' Macro recorded 9/15/2008 by Martin
    '
    '
    Sheets("FOREPIECE").Select
    ActiveWorkbook.Save
    ActiveWorkbook.Close

    This macro can be triggered from any one of 3 pages. As you can see it takes the focus back the the sheet FOREPIECE, saves the workbook (under its current file name). On the sheet FOREPIECE cell H6 is the current day and date derived from the =TODAY() function.

    What I am trying to do is save the workbook as the value of H6.

    Any help would be gratefully appreciated,

    sivadnitram

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub SAVEANDEND()
    ActiveWorkbook.SaveAs Format(Date,"yyyy-mm-dd")&".xls"
    ActiveWorkbook.Close
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •