+ Reply to Thread
Results 1 to 5 of 5

how to declare action to be used in save as filename?

  1. #1
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    how to declare action to be used in save as filename?

    I have included two parts of my code. The first lets the user select a folder to cycle through all excel documents and run more code against them. Then the second piece of code shows how I currently have created the savefilename (by using the doc count to name the file). This was primarily for testinf but I want to be able to use the name of the document instead of a number.

    I would like to be able to set the current document name (highlighted in red in code section one) and declare it as a variable/string so I can use it in code section 2 instead of the "J" (also highlighted in Red) but I am struggling hard to work out how to do this.

    This is a loop so doc name will change each loop. Is it just a matter of declaring inside the loop (something like set docname = *.xl?? and then use docname in the filename section because I have tried and I cannot get to work correctly)

    Does anyone have any suggestions or solutions for this problem please?

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Last edited by Sc0tt1e; 08-21-2017 at 10:57 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: how to declare action to be used in save as filename?

    Please Login or Register  to view this content.
    ?

  3. #3
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Re: how to declare action to be used in save as filename?

    used the wrong one when typing it up

    Edited in code

  4. #4
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Re: how to declare action to be used in save as filename?

    seriously, nobody know how to get the doc name as a variable so I can use it in the save function?

  5. #5
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Re: how to declare action to be used in save as filename?

    This has not been solved, I am just closing the thread

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If save name taken save as filename(1), file name (2), etc.
    By blackburnsexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2014, 10:14 AM
  2. Macro for save as action on excel
    By gobi615 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2014, 05:40 AM
  3. [SOLVED] Read out Filename and Save all Sheet as Filename.pdf
    By bluesurger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-28-2014, 02:34 AM
  4. Save as dialog with predefined filename does not save
    By a94andwi in forum Excel General
    Replies: 2
    Last Post: 04-20-2012, 03:23 AM
  5. Do action Before Save
    By titaniumjack in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2010, 03:55 PM
  6. not allow a save action if ANY data is missing
    By matt7102 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-26-2008, 05:18 PM
  7. Undo a save action
    By John in forum Excel General
    Replies: 1
    Last Post: 01-26-2006, 02:30 PM

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