Next Blank Cell in a Row

nniedzielski

Well-known Member
Joined
Jan 8, 2016
Messages
598
Office Version
  1. 2019
Platform
  1. Windows
I am looking to dump numerous rows of data into an excel sheet and want to find code that will find the next empty cell in Column B.

I cant seem to find a simple solution utilizing a FinalRow type code.

Does anyone have a simple and easy way for finding this?

thanks,
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
This will give you the row below the last used cell in column B:
Code:
Cells(Rows.Count, "B").End(xlUp).Offset(1, 0)
 
Upvote 0
both of these lines of code give me a syntax error and the bottom on says Expected =
 
Upvote 0
I am using this:

Code:
Dim Lastrow as Long
Lastrow = Cells(Rows.Count, 1).End(xlUp).Row

It is however not actually selecting the cell.
 
Upvote 0
Is that all of your code? Which line generates an error?
Oh, and change the 1 (for column A) to 2 (column B)
 
Upvote 0
That's because your code isn't selecting anything, it is just determining the next empty cell's row number and storing it in a variable.

To select the next cell it would be something like:
Code:
Range("B" & [COLOR=#333333]Cells(Rows.Count, 2).End(xlUp).Row).Select[/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

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