+ Reply to Thread
Results 1 to 2 of 2

Saving file using data from worksheet

Hybrid View

  1. #1
    Patrick Simonds
    Guest

    Saving file using data from worksheet

    I came up with this code to save the active worksheet with a set name and
    the contents of cell Y1 included in the name. But when I finish enter the
    code the program highlights the word Vacation and gives me the following
    error msg "Expected end of statement"

    ActiveWorkbook.SaveAs Filename:= _
    "O:\PT_DRIVER_SCHED\"Vacation Mark-up (PT Drivers) &
    Worksheets("January").[Y1].Value", FileFormat:= _
    xlNormal, Password:="", WriteResPassword:="",
    ReadOnlyRecommended:=False _
    , CreateBackup:=True



  2. #2
    Norman Jones
    Guest

    Re: Saving file using data from worksheet

    Hi Patrick,

    Try changing your quotes:

    ActiveWorkbook.SaveAs Filename:= _
    "O:\PT_DRIVER_SCHED\Vacation Mark-up (PT Drivers)" _
    & Worksheets("January").[Y1].Value, _
    FileFormat:=xlNormal, Password:="", _
    WriteResPassword:="", _
    ReadOnlyRecommended:=False, _
    CreateBackup:=True

    ---
    Regards,
    Norman



    "Patrick Simonds" <[email protected]> wrote in message
    news:[email protected]...
    >I came up with this code to save the active worksheet with a set name and
    >the contents of cell Y1 included in the name. But when I finish enter the
    >code the program highlights the word Vacation and gives me the following
    >error msg "Expected end of statement"
    >
    > ActiveWorkbook.SaveAs Filename:= _
    > "O:\PT_DRIVER_SCHED\"Vacation Mark-up (PT Drivers) &
    > Worksheets("January").[Y1].Value", FileFormat:= _
    > xlNormal, Password:="", WriteResPassword:="",
    > ReadOnlyRecommended:=False _
    > , CreateBackup:=True
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1