+ Reply to Thread
Results 1 to 9 of 9

Specific url/folder called up in Macro. How to make that url dynamic?

  1. #1
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Question Specific url/folder called up in Macro. How to make that url dynamic?

    I have a macro that creates a link of all the pictures I have in a folder. 100 pictures in Folder Jan 2013 will create 100 hyperlinks in excel.

    The problem I face now is that the template that I currently use is used all year. So if I have a random amount of photos in Feb 2013, Mar 2013, Apr 2013, etc. I should have that exact same amount of photos from those folders.

    I don't have to want to go every single time to the macro and change the folder/url location. Is there a way I can have the macro say to get the files from cell Z1

    where Z1 is a dynamic hyperlink I have created?
    Part of Z1 recalls other cells. A1 says Month:, and B1 = Feb 2013

    If I update B1 every month to the new month, then the hyperlink in Z1 will automatically update. However, how can I use that dynamic hyperlink reference in the macro instead of having to always literally spell out the file location?

  2. #2
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Specific url/folder called up in Macro. How to make that url dynamic?

    Does a Macro allow to recall a specific folder by referring to the Spreadsheet cell instead of the file address?

  3. #3
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Specific url/folder called up in Macro. How to make that url dynamic?

    This is the macro that I have

    Please Login or Register  to view this content.
    Because every month the URL address will be different, I don't want to have to go every month and change:

    1) The month section of the URL: 05 May\
    2) The name of the inspector Frank Butler\

    Rather than put in the macro the full URL path, how can I have it say instead

    Set fol = fs.getfolder("\\ABCDEFG.com\workgroupABC\TDBU26\E&TS DR\Working\Quality\Inspections\M&I_Inspections\Photos_ODI\05 May\David Butler\")

    to

    Set fol = fs.getfolder("A34")

    Where A34 in the cell of Sheet1 (or whichever sheet) gives the updated URL.

  4. #4
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Specific url/folder called up in Macro. How to make that url dynamic?

    Is what I'm asking for possible in excel vba?

  5. #5
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Specific url/folder called up in Macro. How to make that url dynamic?

    Does anyone know?

  6. #6
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Specific url/folder called up in Macro. How to make that url dynamic?

    Can anyone at least point me to the right path?

  7. #7
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Specific url/folder called up in Macro. How to make that url dynamic?

    I have tried google searching but I can't seem to find anywhere what I am looking for.

    Once I set the file path in the macro, can't I change it so that rather than putting the path, I can put the cell address (example: B31) and that way I can keep it dynamic?

  8. #8
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Specific url/folder called up in Macro. How to make that url dynamic?

    I give up.

  9. #9
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Specific url/folder called up in Macro. How to make that url dynamic?

    instead of:
    Please Login or Register  to view this content.
    Use:
    Please Login or Register  to view this content.
    This will set the folder to the URL stored in cell A34.

+ 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. edit macro to make it run on all files in a folder
    By rohit43 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-09-2013, 05:46 PM
  2. [SOLVED] Macro to open specific folder
    By siobeh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2013, 04:22 PM
  3. [SOLVED] Macro to save workbook to specific folder with a specific name, then kill/disable itself.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2012, 03:50 PM
  4. How to make VBA macro sub run independently of called application?
    By hsupadrasta in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2009, 02:40 AM
  5. Make Called Macro End the First Macro
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2007, 11:38 AM

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