+ Reply to Thread
Results 1 to 8 of 8

Referencing filename in a saveas function

  1. #1
    Registered User
    Join Date
    10-01-2007
    Posts
    9

    Referencing filename in a saveas function

    I have several hundred spreadsheets that have some minor editing (removing columns and such) that is the same across the board. I had no problems getting a macro setup to do this. Then I thought rather than saving every file manually with "Revised" after the filename, I could build this into the macro.

    The problem is, I don't know how to get the filename in as a variable. Everything I have seen has referenced the file name as a static, or worse yet, user inputtable value. Yikes!

    While we are on the subject, what is needed to get the macro sets up so it opens a file, runs through the steps, saves, closes, and moves on to the next in the directory?
    Last edited by VBA Noob; 10-01-2007 at 11:04 AM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    If you looping through workbooks maybe

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-01-2007
    Posts
    9
    Quote Originally Posted by VBA Noob
    If you looping through workbooks maybe

    Please Login or Register  to view this content.
    VBA Noob
    Soooooooo...
    Please Login or Register  to view this content.
    I think I am missing something here...

  4. #4
    Registered User
    Join Date
    10-01-2007
    Posts
    9
    When I try above, it generates "Compile Error: Expected Function or variable".

    See attached error screen... thoughts?
    Attached Images Attached Images
    Last edited by Mechroneal; 10-01-2007 at 01:47 PM.

  5. #5
    Registered User
    Join Date
    10-01-2007
    Posts
    9
    New error screen added.

  6. #6
    Registered User
    Join Date
    10-01-2007
    Posts
    9
    Anybody? I know this is close, but I have no idea what I am not doing right here.

  7. #7
    Registered User
    Join Date
    10-01-2007
    Posts
    9

    Unhappy

    OK, last bump. If I can't get this figured out, I'll just have users do a manual saveas.

  8. #8
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Try something like:

    Please Login or Register  to view this content.

+ 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