+ Reply to Thread
Results 1 to 9 of 9

Selecting cells in one column based on criteria in another

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Selecting cells in one column based on criteria in another

    Selecting cells in one column based on criteria in another

    Hi All

    I need some help with some VBA code please. I'm using Excel 2003.

    I need to select the cells in Column L which are below an input number in Column A.

    For example , a message box would request an input. I enter 4000. It looks down column A and where the cell value is below 4000 , it selects the equivalent cells by row in column L.

    For example

    If A1 contains a number less than the input number , then cell L1 is selected. This would loop through all the numbers in A and select equivalent cells in L.


    Grateful for any help.


    Best Wishes ,

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Selecting cells in one column based on criteria in another

    Does this help?

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 03-15-2017 at 11:39 AM.

  3. #3
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Selecting cells in one column based on criteria in another

    hi John

    Ok thanks for getting back so quickly. I gave it a go and it gave an error.

    See attached.

    The debugger highlighted this line :

    Range(z).Select

    Grateful for your advice.

    Best Wishes ,
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Selecting cells in one column based on criteria in another

    Can you attach the actual file (use dummy data) which causes the error?

  5. #5
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Selecting cells in one column based on criteria in another

    Hi

    Yes , of course. It is attached.

    Best Wishes ,
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Selecting cells in one column based on criteria in another

    Um. I can't duplicate the error when I run it?

  7. #7
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Selecting cells in one column based on criteria in another

    Hi John

    How strange.

    I ran it again on the small sample file I sent before and it didn't give an error , but didn't select any cells either.

    I also tried again with my full file and after some hesitation , it gives the error as before.

    I'm using 2003 here , maybe that's the issue.

    I don't know if there's another way around...

    Best Wishes ,

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Selecting cells in one column based on criteria in another

    If no one else helps out, I will take another look tomorrow. Although I couldn't duplicate the error and I do get results. They results I'm getting does not meet the requirement.

  9. #9
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Selecting cells in one column based on criteria in another

    Hi John

    OK thanks for your help. It's appreciated.

    Best Wishes ,

+ 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. Selecting cells in one column based on criteria in another
    By CDandVinyl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2017, 11:30 AM
  2. Selecting cells in one column based on criteria in another
    By CDandVinyl in forum Excel General
    Replies: 0
    Last Post: 03-14-2017, 09:56 PM
  3. Selecting random cells based on criteria
    By JamesTrethowan in forum Excel General
    Replies: 8
    Last Post: 10-28-2015, 11:15 AM
  4. Using Avergeifs and selecting last 8 cells based on criteria
    By boyesmar in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-29-2013, 09:53 AM
  5. Using Avergeifs and selecting last 8 cells based on criteria
    By boyesmar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-23-2013, 09:20 PM
  6. [SOLVED] Finding Values in a Column based on Criteria and Selecting Rows Above
    By LvaughnL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2013, 03:07 PM
  7. Selecting Range of Cells based on Criteria
    By gmclauchlan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2011, 12:19 PM

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