+ Reply to Thread
Results 1 to 6 of 6

select only cells with content

  1. #1
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201

    select only cells with content

    Hi all,

    Is it possible to use the next code:
    Please Login or Register  to view this content.
    and then reduce the selected cells to only those that have content.

    Normally the selection of an entire column is not a problem but the next step in the code is:

    Please Login or Register  to view this content.
    etc.

    Because a lot of cells will be empty and / or have no color in it, this takes a lot of time.

    Thanks in advance
    Hein
    Last edited by Hein; 01-06-2009 at 10:28 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You had \code instead of /code in the tags

    Try this
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201
    Hallo (again!) Roy,
    Thanks for your reply

    I see what you mean. In fact it dawned at me while I was fetching a cup of tea that the "go-to" possibility might be a solution.

    Using your code gives me error 1004: no cells are found

    If I use the macro recording I get the code
    Please Login or Register  to view this content.
    This results in the same message/error

    Thanks
    Hein

    PS
    An other approach gives me the desired results:
    I noticed that all cells contain formulas. Using the code
    Please Login or Register  to view this content.
    gives me the desired results
    So thanks for putting me on the right track

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    It's always best to add an On error goto with SpecialCells just in case no cells match the requirements.

  6. #6
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201
    Thanks for the addition
    In this case cells must change but I can use your remark in other places
    Hein

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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