+ Reply to Thread
Results 1 to 4 of 4

How to determine if Range spans more then one row??

  1. #1
    Registered User
    Join Date
    01-29-2009
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2003
    Posts
    21

    How to determine if Range spans more then one row??

    I have vb putting a cell range in a variable. Is there a way to determine if the range spans more then one row?

    The variable can contain a range that is on one row - e.g. "$B$5:$E$5"
    or
    The variable can contain a range that spans rows - e.g. "$b$5:$C:$7"

    Subsequent logic can only operate on a single row so I would like to put out an error message if the range spans rows.

    Thanks in advance,
    George

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to determine if Range spans more then one row??

    How is the range assigned?
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-29-2009
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: How to determine if Range spans more then one row??

    variable is populated via vb statement myRange = currentActiveCell()

    where currentActiveCell() is the following function:

    Function currentActiveCell()
    Application.Volatile
    currentAcitiveCell = Selection.address
    end Function

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to determine if Range spans more then one row??

    Please edit your post to add code tags.

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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