+ Reply to Thread
Results 1 to 4 of 4

Range issue

  1. #1
    Registered User
    Join Date
    02-27-2006
    Posts
    16

    Range issue

    I would like my macro to look for the first empty line and use that as the secdond range value. So for example,

    Do while ActiveCell<> empty
    activecell.offset(1,0).Select
    loop
    Range("A3:activecell.offset(-1,0)").select


    The problem is activecell.offset(-1,0) doesn't appear to be a valid Range argument.

  2. #2
    Excel_Fun
    Guest

    Re: Range issue

    It will be a valid argument if you don't use it as a string - text.

    Try this:

    Range("A3", ActiveCell.Offset(-1, 0)).Select

    good luck,
    Excel_Fun


    evil baby napisal(a):
    > I would like my macro to look for the first empty line and use that as
    > the secdond range value. So for example,
    >
    > Do while ActiveCell<> empty
    > activecell.offset(1,0).Select
    > loop
    > Range("A3:activecell.offset(-1,0)").select
    >
    >
    > The problem is activecell.offset(-1,0) doesn't appear to be a valid
    > Range argument.
    >
    >
    > --
    > evil baby
    > ------------------------------------------------------------------------
    > evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983
    > View this thread: http://www.excelforum.com/showthread...hreadid=519719



  3. #3
    Bob Phillips
    Guest

    Re: Range issue

    Don't bother with it, use this instead

    Do While ActiveCell.Offset(1, 0) <> Empty
    ActiveCell.Offset(1, 0).Select
    Loop


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "evil baby" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I would like my macro to look for the first empty line and use that as
    > the secdond range value. So for example,
    >
    > Do while ActiveCell<> empty
    > activecell.offset(1,0).Select
    > loop
    > Range("A3:activecell.offset(-1,0)").select
    >
    >
    > The problem is activecell.offset(-1,0) doesn't appear to be a valid
    > Range argument.
    >
    >
    > --
    > evil baby
    > ------------------------------------------------------------------------
    > evil baby's Profile:

    http://www.excelforum.com/member.php...o&userid=31983
    > View this thread: http://www.excelforum.com/showthread...hreadid=519719
    >




  4. #4
    Registered User
    Join Date
    02-27-2006
    Posts
    16
    Thanks for the help, didn't even bother to look at where I had the quotes.

+ 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