Finding next TRULY empty row - VBA

stingwraith

New Member
Joined
Mar 13, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello, I've recently been attempting to get the next completely empty row in order to add data to it. Normally this would be pretty straight-forward, however I'm running into an issue where if the last row contains values that AREN'T in the cell on column A, then it will overwrite the last line. i.e.: if there's something on the last line in the B column but NOT in the A column, it will be found to be an empty line and be overwritten.

The goal of this is to execute the macro on values on 'Sheet1', then have those values removed from 'Sheet1' and added to a new line on 'Sheet2', essentially keeping a record.

Here's what I've tried so far:

Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row 1
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
ActiveCell.Offset(1).Select 'This line moves the selected cell down by one.
Range("A1").End(xlDown).Offset(1, 0).Select
Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Select
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
Range(Selection, Cells(Rows.Count, Selection.Column).End(xlDown)).Select

Any help would be greatly appreciated.
 
If you want it to paste in the next blank row in Sheet2 then

VBA Code:
Sheets("Sheet2").Range("A" & Sheets("Sheet2").Cells.Find("*", , xlValues, , xlByRows, xlPrevious).Row).Offset(1).PasteSpecial

OMG it works!!! Thanks so much for your help!!
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Happy it helped and welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,216,031
Messages
6,128,422
Members
449,450
Latest member
gunars

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top