+ Reply to Thread
Results 1 to 3 of 3

How to select/unselect range based on variables

  1. #1
    Registered User
    Join Date
    12-10-2009
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    How to select/unselect range based on variables

    Hi, I'm very new to programming...

    Right now I'm writing Excel macros that will sort data in accending order.

    From the macro recording I have:
    Please Login or Register  to view this content.
    However, I want to unselect the rows if the value for first cell of that row (Cells(x,1)) is empty. So that only the row where Range("Ax")<>Empty are selected.

    I tried using variables and if... then commands but none worked. Any ideas? Thanks in advance!! =)
    Last edited by kirba; 12-10-2009 at 11:50 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to select/unselect range based on variables

    Not sure I understand... you can't sort non-contiguous ranges simultaneously.

    Care to post an example file which illustrates both "before" and desired "after" ?

  3. #3
    Registered User
    Join Date
    12-10-2009
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to select/unselect range based on variables

    Ok I'll be more specific.
    Right now my table looks like this when highlighted:
    <img src="http://i50.tinypic.com/20sd3pv.jpg">
    The white font is invisible when it is unhighlighted. I can't clear out the cells completely because they are in a formula.
    Now, if I want to sort out the rows in ascending order according to the LAST column, the forementioned EMPTY rows would come first, but I want them to remain in the bottom of course.
    So this is what I'm try to design my macros to do, select the rows and sort them out in ascending order when the values for the A column are NOT empty. Hence leave out the empty rows. However so far my knowledge of VBA is not enough to do so.
    Please help me think of any ideas...
    Thanks!

+ 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