+ Reply to Thread
Results 1 to 4 of 4

Userform to edit macro?

  1. #1
    Registered User
    Join Date
    05-20-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    33

    Userform to edit macro?

    Hi,

    I had a little search but couldn't find anything on the subject.
    I'm wondering if its possible to create a userform that can update code in a macro?

    Specifically, I have a macro that updates external data but the link for this external data changes weekly. So rather than have to edit the macro manually, the userform will do it when requested.

    Here is an example of the code, with the sections required to be changed highlighted in red:

    ActiveWorkbook.UpdateLink Name:="T:\Filepath\Data\week 36\file wk36.xlsx", Type:= _
    xlExcelLinks

    Thanks in advance for any time or assistance with this.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Userform to edit macro?

    hi mungel
    with your userform

    Please Login or Register  to view this content.
    where textbox1 has the 36 text
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Userform to edit macro?

    You could add a Browse for file button or simply ask the user within the code to select a file

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    05-20-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    33

    Re: Userform to edit macro?

    Hi,

    Thanks for the replies.
    Both are excellent ideas and I will try them both out to see which fits better.
    The general idea is to make the weekly update process easy enough for anyone to do.
    Unfortunately, that means 'really' computer illiterate people in some cases.

    Many thanks.


+ 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