+ Reply to Thread
Results 1 to 6 of 6

Macro Relative File Path Help

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2010
    Posts
    52

    Macro Relative File Path Help

    - Each month I must update "final reports" which contain information from "initial reports" which are saved monthly in folders containing the new month and year

    - How can I design a macro that completes the basic data entry for me, thus saving time and limiting typos?

    - While I am familiar with recording macros, I am not familiar with how to build a macro that will easily pull information from a new file path

    - The file path will be different each month, however, it will follow the same naming pattern ie this month it is "2013 > 0113" next month it will be "2013 > 0213"

    Thank you for your time and help.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro Relative File Path Help

    You construct your filepath before trying to save.

    Please Login or Register  to view this content.
    Now you can use the fPATH variable in your save command.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-20-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Macro Relative File Path Help

    JBeaucaire,

    Thank you for your reply. Unfortunately, your reply is a bit over my head as I am a very basic excel user. I only know how to find and hit the "record macro" button, complete my task, and hit the "stop recording" button. Can you elaborate on your post for a layman like myself?

    Thank you for your time and I apologize for my inexperience.

    Sincerely,
    Centexcel

  4. #4
    Registered User
    Join Date
    02-20-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2010
    Posts
    52

    Relative/Variable File Path Macro Help

    This is a slight re-post as JBeaucaire was nice enough to answer me earlier, however, I left out some crucial details which will change the answer to my query:

    - Each month I must update my "final reports" which contain information from my "initial reports" which are saved monthly in folders containing the a new month and year. Right now I am doing a lot of manual data entry.

    - How can I design a macro that completes the basic data entry from my "initial reports" from the new file path to my "final reports" which do not change file paths. I want to save time and limit typos.

    - The "initial report" file path will be different each month, however, it will follow the same naming pattern ie this month my "initial reports" are saved under "2013 > 0113" next month it will be "2013 > 0213"

    - While I am familiar with recording macros (ie I press the record/stop button), I am not familiar with VBA or how to build a macro that will easily pull information from a new file path. I will be forever grateful for step by step instructions.


    Thank you for your time and help!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro Relative File Path Help

    You must do as much work as you can. We all use the macro recorder to get base code that records our desired steps, then we tweak that code to make it more efficient. Get your recorded macro in place and working for a single instance, then post that code, we'll show you how to add in the variables as demonstrated before.

    You will need to get comfortable with Googling and researching other existing macros and reading through them to best teach yourself these concepts.
    We've all been through it, you'll be fine, just have to dive in.
    Last edited by JBeaucaire; 02-21-2013 at 12:11 PM.

  6. #6
    Registered User
    Join Date
    02-20-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Macro Relative File Path Help

    Thank you for your reply and I really value the encouragement. I will do my best to learn and develop something and then post the script.

    Thanks again, I cannot tell you how thankful I am to have access to a forum of experts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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