+ Reply to Thread
Results 1 to 3 of 3

Prompt allowing Macros to be adjusted based on user's keyword

  1. #1
    Forum Contributor
    Join Date
    01-28-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    105

    Smile Prompt allowing Macros to be adjusted based on user's keyword

    I would like to replace all instances of Month1 below with a user inputted keyword upon prompt in this macros. For instance, a prompt appears in the beginning of the macros asking for a user input, of which the user will enter either Month1, Month3, Month5, Month7, Month9, or Month11. That will be substituted throughout the rest of the macros in the following spots. Would appreciate help.


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    01-28-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Prompt allowing Macros to be adjusted based on user's keyword

    Figured it out, its quite simple. Just have variable = textbox input. Then replace all Month1 with the "& variable &" for anyone else who might run into this problem. Thanks!

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Prompt allowing Macros to be adjusted based on user's keyword

    Hi,
    just a small tip: selecting anything in code is very rarely necessary. Your code will be shorter and more efficient if you avoid it. For example, rather than selecting a sheet and then deleting the selected sheet, you can simply delete by name:
    Please Login or Register  to view this content.
    Last edited by romperstomper; 03-29-2010 at 03:33 AM.
    Remember what the dormouse said
    Feed your head

+ 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