VB Code to Select Next Empty Row If Row of ActiveCell Has Value

Stonesteel

Board Regular
Joined
Apr 27, 2010
Messages
81
Greetings!

May I ask what vbcode should I use to move down to the next empty row if the current row has already a value? for example, Rows 1-3 had values already, it will move to Row 4 which is empty. Something like,

If Row 1 (with 10 Columns) has value then move to Row 2 but
If Row 2 (with 10 Columns) has value then move to Row 3 but
If Row 3 (with 10 Columns) has value then move to Row 4, if empty then
Fill Row 4 with data (with 10 Columns), then move to Row 5 to fill data (with 10 Columns) again.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try like this

Code:
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
 
Upvote 0
Code:
Sub GoToNextEmptyRow()

    Dim rngEmpty As Range
    
    ' Say, A1:J15 has data
    Set rngEmpty = Range("A1").End(xlDown).Offset(1)

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,350
Messages
6,124,430
Members
449,158
Latest member
burk0007

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