Ask Your Question
0

macro to obtain row column like ctrl-end does

asked 2016-04-15 20:00:09 +0200

Norisezp gravatar image

I need a basicmacro in Calc that will get the row and column of the last filled cell like ctrl-end does, but without moving the cursor. Any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-04-16 11:17:28 +0200

pierre-yves samyn gravatar image

Hi

The UsedRange.ods attached contains 3 macros.

  • UsedRange gives the column and line numbers of the used range
  • UsedRangeFrom gives the column and line numbers of the used range, starting with F3
  • UsedRangeFormula gives (and select) the range displaying results in a calculated column

More details on this wiki page (french).

Regards

edit flag offensive delete link more

Comments

Hello @pierre-yves samyn

I've seen a slightly different answer at here

Can you teach the other way ? Thank you

moshe11 gravatar imagemoshe11 ( 2016-04-17 01:33:24 +0200 )edit

Hi @moshe11

This answer is not different: it also uses a cursor (a way to virtually move in sheet, current selection is not changed). This tool (cursor) expects a boolean.

  • False: after "going to end" you get a cell.
  • True: you get a range of cells.

In 2 cases the returned object has an address. The address is a complex object with properties including the end column / row.

Regards

pierre-yves samyn gravatar imagepierre-yves samyn ( 2016-04-17 06:45:04 +0200 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2016-04-15 20:00:09 +0200

Seen: 420 times

Last updated: Apr 16 '16