+ Reply to Thread
Results 1 to 3 of 3

VBA to select a range on active row

  1. #1
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2016
    Posts
    140

    VBA to select a range on active row

    Hi,
    I have a VBA script that searches each cell of a column set by a range for a specific word.
    What I want to do is when the word is found, select a range on the active row.

    Unfortunately, my workplace will not allow me to upload the spreadsheet.

    So:

    The script will be used on different spreadsheets, the number of columns used will not always be the same.
    My script searches the firs word for the column heading "File Path" and then searches that column for the word "Test".
    (all the above works fine, the next section is what I cannot get correct)

    When the word "Test" is found I need the script to;
    Move to the first column of the active row and select the cells of that row up to the last non-blank cell.
    I cannot use the standard 'Offset' function because the column I am searching could be different each time.

    I have tried
    Please Login or Register  to view this content.
    The end result is the script will search for a word in the column.
    If it finds the word, select that active row up to the last non-blank cell.
    'Fill' the select cells so that they stand out.

    Thanking you in advance

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent SAC
    Posts
    8,885

    Re: VBA to select a range on active row

    Try this:

    Please Login or Register  to view this content.
    Rory

  3. #3
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2016
    Posts
    140

    Re: VBA to select a range on active row

    rorya, that works great - thank you.

+ 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. [SOLVED] select range based on active range
    By kingcashandcarry in forum Excel General
    Replies: 2
    Last Post: 02-01-2020, 03:00 AM
  2. [SOLVED] How to select a range within the active column ?
    By DaChocapic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2017, 11:26 AM
  3. Select a range from active cell
    By Spagbog in forum Excel General
    Replies: 1
    Last Post: 12-21-2011, 08:17 AM
  4. Select Range in Active Row
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2011, 02:55 AM
  5. Select range from active cell
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-22-2010, 11:42 AM
  6. how to auto-select range of active cell
    By panamakevin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2010, 12:46 AM
  7. [SOLVED] How to select range of Active Window
    By Jan in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-01-2006, 01:10 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