Calculating rows and columns compared to a given cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top