VBA & Macro Problems

How to Copy Excel Rows Until “Waiting for Data” Appears in WPS Spreadsheets

Tauseeq MagsiTauseeq Magsi Nov 13, 2026 868 views

Question details

The user needs to copy worksheet rows that contain scanned codes and INDEX/MATCH results to another worksheet, stopping before the first row that displays “Waiting for data...” in column O.

Product
WPS Spreadsheets
Device & OS
not provided
Scenario
The user is processing scanned-code data and wants to export or archive completed rows while excluding a pending placeholder row.
Observed behavior
The expected result is a value-only copy in the destination worksheet that includes all rows above the “Waiting for data...” marker and excludes the marker row itself.
Before you start

Open the workbook in WPS Spreadsheets and confirm which column contains the “Waiting for data...” marker (the example uses column O). Also check the destination worksheet name and, if you plan to run VBA, enable the Developer tab from the ribbon.

Solution 1Recommended

Use a VBA Macro to Copy All Rows Above the “Waiting for data...” Marker

Use this when you need a repeatable, dynamic copy that pastes only values and automatically stops before the placeholder row.

The macro uses Application.Match to locate the first exact “Waiting for data...” value in column O. It then copies the block from row 3 down to one row above that match and pastes it as values into the destination worksheet.

1
Open the VBA editor

Click the Developer tab in WPS Spreadsheets, then click Visual Basic. If the Developer tab is not visible, enable it from the ribbon options or press Alt+F11.

2
Insert a module and paste the macro

In the VBA editor, click Insert > Module, paste the CopyRows code into the module, and adjust the marker column, destination sheet, and starting row as needed.

3
Run the macro

Press F5 or click Run > Run Sub/UserForm to execute the macro. The rows before the first “Waiting for data...” row are copied to the specified destination range.

4
Check the destination worksheet

Switch to the destination worksheet and verify that the copied values start in the expected cell and the “Waiting for data...” row is not included.

Use a VBA Macro to Copy All Rows Above the “Waiting for data...” Marker
Values-only result: The macro uses PasteSpecial with xlPasteValues, so INDEX/MATCH results are pasted as static values rather than live formulas.
WPS Spreadsheets VBA Solution

Copy Excel Rows Until “Waiting for Data...” with WPS Spreadsheets

Use the VBA editor in WPS Spreadsheets to identify the first “Waiting for data...” row and copy the completed scanned-code and INDEX/MATCH results above it to another worksheet as values.

  1. 1. Open your workbook and the VBA editor: In WPS Spreadsheets, open the workbook and click Developer > Visual Basic. If the Developer tab is hidden, enable it from the ribbon options.
  2. 2. Insert the CopyRows module: Click Insert > Module in the VBA editor and paste the CopyRows macro into the new module.
  3. 3. Set the source and destination references: Update the column O reference, starting row, and destination worksheet name to match your actual workbook layout.
  4. 4. Run and verify the copy: Press F5 to run the macro, then open the destination worksheet to confirm the rows above “Waiting for data...” were copied as values.
Stops copying exactly before the first “Waiting for data...” rowPastes INDEX/MATCH results as static valuesSupports Excel .xlsx, .xlsm, and macro-enabled workbook formatsRuns familiar VBA code in a free, lightweight Office suite
QA img-9

Frequently Asked Questions

What does the VBA macro use to find the stop row?

The macro uses Application.Match to find the first exact “Waiting for data...” value in column O, then copies from the starting row to one row before that match.

Can I run this VBA code in WPS Spreadsheets?

Yes. WPS Spreadsheets includes a VBA editor, so you can insert and run the same macro code you would use in Excel after adjusting the sheet and range references.

Does the FILTER formula work in all WPS Office versions?

FILTER is a dynamic array function and may not be available in older WPS Office versions. In that case, use the VBA macro instead.

Will the pasted INDEX/MATCH results continue to update?

No. The VBA method uses PasteSpecial with xlPasteValues, so the copied results become static values.

What should I do if the marker row is not found?

Check that the marker text in the cell is exactly “Waiting for data...” with no extra spaces, and ensure the macro is searching the correct column.