+ Reply to Thread
Results 1 to 3 of 3

Reverse the order?

  1. #1
    davegb
    Guest

    Reverse the order?

    I got the following code here. It finds the currrent area minus the row
    at the bottom (Totals) to be filtered. In one sheet, it doesn't include
    a couple of columns because of a blank cell in the bottom row. I
    checked, and the top row and last column always have data in all cells.
    I've been trying to figure out how to do the same thing but go across
    first, then down. But I can't figure it out! Anyone know how to reverse
    this?

    Set rStart = Range("B4")
    lRow = rStart.End(xlDown).Offset(-1, 0).Row
    lCol = Cells(lRow, Columns.Count).End(xlToLeft).Column
    Set rEnd = Range(rStart, Cells(lRow, lCol))

    Thanks for the help!


  2. #2
    Tom Ogilvy
    Guest

    Re: Reverse the order?

    Set rStart = Range("B4")
    lCol = rStart.End(xlToRight).Column
    lRow = cells(rStart.row,lcol).End(xldown).Row - 1
    Set rEnd = Range(rStart, Cells(lRow, lCol))

    --
    Regards,
    Tom Ogilvy


    "davegb" <[email protected]> wrote in message
    news:[email protected]...
    > I got the following code here. It finds the currrent area minus the row
    > at the bottom (Totals) to be filtered. In one sheet, it doesn't include
    > a couple of columns because of a blank cell in the bottom row. I
    > checked, and the top row and last column always have data in all cells.
    > I've been trying to figure out how to do the same thing but go across
    > first, then down. But I can't figure it out! Anyone know how to reverse
    > this?
    >
    > Set rStart = Range("B4")
    > lRow = rStart.End(xlDown).Offset(-1, 0).Row
    > lCol = Cells(lRow, Columns.Count).End(xlToLeft).Column
    > Set rEnd = Range(rStart, Cells(lRow, lCol))
    >
    > Thanks for the help!
    >




  3. #3
    davegb
    Guest

    Re: Reverse the order?

    Worked great! Thanks Tom.

    Tom Ogilvy wrote:
    > Set rStart = Range("B4")
    > lCol = rStart.End(xlToRight).Column
    > lRow = cells(rStart.row,lcol).End(xldown).Row - 1
    > Set rEnd = Range(rStart, Cells(lRow, lCol))
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "davegb" <[email protected]> wrote in message
    > news:[email protected]...
    > > I got the following code here. It finds the currrent area minus the row
    > > at the bottom (Totals) to be filtered. In one sheet, it doesn't include
    > > a couple of columns because of a blank cell in the bottom row. I
    > > checked, and the top row and last column always have data in all cells.
    > > I've been trying to figure out how to do the same thing but go across
    > > first, then down. But I can't figure it out! Anyone know how to reverse
    > > this?
    > >
    > > Set rStart = Range("B4")
    > > lRow = rStart.End(xlDown).Offset(-1, 0).Row
    > > lCol = Cells(lRow, Columns.Count).End(xlToLeft).Column
    > > Set rEnd = Range(rStart, Cells(lRow, lCol))
    > >
    > > Thanks for the help!
    > >



+ 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