+ Reply to Thread
Results 1 to 2 of 2

Calculating rows and columns compared to a given cell

  1. #1
    clippan
    Guest

    Calculating rows and columns compared to a given cell

    Hi, I would like to calculate the number off rows(rw) and the number of
    columns (cl) between an ActiveCell and a given cell in a worksheet in a macro.
    Then I will use rw and cl for some other calculations.
    For example: The given cell is B2 or (2,2).
    If the activecell is E7 (5,7) then the answer should be like:
    rw = 5 - 2 = 3 and cl = 7 - 2 = 5
    If the ActiveCell changes to F10 (6,10) the answer should be:
    rw = 6 - 2 = 4 and cl = 10 - 2 = 8.
    Can anyone please tell me how to make those calculations?
    --
    Many thanks in advance !
    Clippan

  2. #2
    Don Guillett
    Guest

    Re: Calculating rows and columns compared to a given cell

    try
    rw=activecell.row-2

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "clippan" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, I would like to calculate the number off rows(rw) and the number of
    > columns (cl) between an ActiveCell and a given cell in a worksheet in a
    > macro.
    > Then I will use rw and cl for some other calculations.
    > For example: The given cell is B2 or (2,2).
    > If the activecell is E7 (5,7) then the answer should be like:
    > rw = 5 - 2 = 3 and cl = 7 - 2 = 5
    > If the ActiveCell changes to F10 (6,10) the answer should be:
    > rw = 6 - 2 = 4 and cl = 10 - 2 = 8.
    > Can anyone please tell me how to make those calculations?
    > --
    > Many thanks in advance !
    > Clippan




+ 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