+ Reply to Thread
Results 1 to 5 of 5

VBA to selct range before running macro

  1. #1
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    VBA to selct range before running macro

    Need a way to ask the user what range they need the Find and Replace to execute on.
    The range will vary based on type of report
    I'm fairly certain that
    Please Login or Register  to view this content.
    needs to change to
    Please Login or Register  to view this content.
    But how can I add the select range?
    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: VBA to selct range before running macro

    Use an Inputbox to have the User indicate the range to be replaced.

    Please Login or Register  to view this content.
    Then use the variable rng in your code
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: VBA to selct range before running macro

    I'm at a loss with your
    Then use the variable rng in your code
    Can you help me out with where to place

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: VBA to selct range before running macro

    Or if you want to select a range with your mouse.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: VBA to selct range before running macro

    Thank you for this additional input.

+ 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. If formula to selct another column
    By jezza25 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-03-2014, 08:00 PM
  2. [SOLVED] Macro for running a macro when any cell in a range of cells changes
    By gm2612 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-27-2013, 11:36 PM
  3. Subscript Out of Range (Error) when running a macro
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2013, 04:38 PM
  4. worksheet_calculate macro running only on a specific range
    By Skell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2012, 04:24 PM
  5. [SOLVED] range names disappear when running a macro
    By dvb_24 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2011, 05:03 AM
  6. Name range is not saving when running macro
    By sratkins in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-18-2008, 07:33 AM
  7. Selct and edit sheet
    By NNothard in forum Excel General
    Replies: 3
    Last Post: 08-14-2006, 02:21 PM
  8. [SOLVED] Running a macro in a predetermine range if not them msgBox
    By KBrenner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2006, 10:25 AM

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