Results 1 to 5 of 5

Using current.region less 1 column

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    04-11-2006
    MS-Off Ver
    2007
    Posts
    438

    Using current.region less 1 column

    How can I use this code but tell it to select all but the right-most column?

    Why?

    I have this piece of code...

       Set Rng = Range("A2")
        Set RngEnd = Cells(Rows.Count, Rng.Column).End(xlUp)
        Set Rng = IIf(RngEnd.Row < Rng.Row, Rng, Range(Rng, RngEnd))
        Range("L2") = Rng.Rows.Count

    which puts the results in L2.

    The code below must come after the code above. So If I leave it as is, the code below then selects column L as part of the print area, which I don't want.


    ActiveSheet.PageSetup.PrintArea = [A1].CurrentRegion.Address

    Thanks much
    Last edited by duugg; 03-31-2009 at 04:54 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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