+ Reply to Thread
Results 1 to 5 of 5

How to select range of cells that equal certain value...need help improving code.

  1. #1
    Registered User
    Join Date
    04-04-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    27

    How to select range of cells that equal certain value...need help improving code.

    I have this code to select range of cells that equal to China in a master sheet. However i know this code can be simplified. Can you guys help me? Basically i want to select a column A cells of a country in a mastersheet. Can't figure out how to improve this.


    Please Login or Register  to view this content.

    Thank You

  2. #2
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: How to select range of cells that equal certain value...need help improving code.

    Hi,

    If you column A don't contains blank cells in between you can use filter technique to select the cells with China in it with the below code.

    Please Login or Register  to view this content.

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

    Re: How to select range of cells that equal certain value...need help improving code.

    Or something like this maybe.
    Please Login or Register  to view this content.
    or this
    Please Login or Register  to view this content.
    Last edited by jolivanes; 10-24-2014 at 02:50 PM. Reason: more info

  4. #4
    Registered User
    Join Date
    04-04-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: How to select range of cells that equal certain value...need help improving code.

    Awsesome thank you!!

  5. #5
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: How to select range of cells that equal certain value...need help improving code.

    Thats because in cell A5 & A6 you have extra trailing space what you see as "BS" is actually "BS ". SO deleting those extra spaces will give you the result.

    See the file.
    Attached Files Attached Files

+ 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] VBA Code to select Range of cells as Email Body In Outlook
    By naveenmarapaka in forum Outlook Programming / VBA / Macros
    Replies: 5
    Last Post: 09-16-2013, 06:43 AM
  2. improving code by removing select
    By Zealotwraith in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2013, 04:13 PM
  3. VBA code to select cells, row by row in range, based on condition
    By Vera22 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-31-2012, 11:12 AM
  4. Need code to select a range of cells based on criteria in column H
    By davekippen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2011, 01:40 PM
  5. Code to select a range of cells based on cursor location
    By kys2000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2007, 05:57 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