Active Cell contents

I have a macro that runs through each row in turn copying data to another sheet. It selects $A$1, then uses the uno:GoDown to select the next cell (all this works). However I want to loop whilst the cell has data in it. I have tried

TempOpID = ThisComponent.CurrentSelection.Value
While TempOpID <> “”

But this returns 0. How do I get the contents of the active cell?

Generally:

  1. Wherever possible describe what you want to achieve. As a beginner don’t focus on your specific attempts or ideas which may not be advisable from the beginning.
  2. The standard way to have data originally entered into one sheet also available and shown in a different sheet of the same spreadsheet document is the usage of formulas.
  3. For huge lots of data or/and if they shall be moved to a different place where they are no longer afflicted by probable changes to their original positions (“archiving storage”) a filter with remote output should be the appropriate tool.
  4. An image is next to never of use for someone trying to help. Attach images only if your issue is expressly about the view. A reduced/simplified example document (here .ods ) is often extremely useful. In case of reduced size a note about the actual size is helpful.

Also:
Spreadsheet cells can contain data of two types: Text (String), Number.
They can also contain formulas (and then show results or error messages).
A cell without any content is called blank. A sub can check for this case by the condition cell.Type=0

1 Like

Value - is number (double), so it will be 0.0 for empty cell
String - is (surprise!) string, so it will be “” (“empty string”) for empty cell

Thanks, I’m new to all this!!! You can tell!!