Copy cell to first BLANK cell in column, NOT the first blank cell from the last row used

Eyeson15

Board Regular
Joined
Apr 30, 2015
Messages
201
Hi,

Please help me create a VBA code.

I have been googling for a long time and the solutions it provides is not quiet what I need.

I would like to copy a cell and paste into FIRST BLANK CELL in column B.

Column B is a long column of data and it has gaps. So the cell I select needs to be copied into the first BLANK gap in column B.

All the solutions seem to paste it at the bottom of column B after the last non-blank cell.

Thank you!

James
 
Hi Rick

I have no problem sharing but thought I was helping the helping community by not presenting a huge script that induces headache attacks :)

Your code, My Aswer's code works well for blank cells. Thank you so much for your efforts.

You are absolutely right, the blank cells are probably displaying "".

Hope all this info also helps someone else. The code I put in post 2 is serving me nicely (albeit bit clunky).

Thanks again.

James
 
Last edited:
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
You are absolutely right, the blank cells are probably displaying "".
Curious... you have formulas in Column B that you plan to overwrite with constants? Anyway, given that, this will tell you the row number of the first blank cell (no matter if it is truly blank or has a formula displaying "") in Column B which you can use to form a cell reference with...

Code:
[B][COLOR="#008000"]' If you declare your variables, put this line with them[/COLOR][/B]
Dim LastRow As Long, FirstBlankRow As Long

LastRow = Cells.Find("*", , xlFormulas, , xlRows, xlPrevious).Row + 1
FirstBlankRow = Evaluate(Replace("MIN(IF(B1:B#="""",ROW(B1:B#)))", "#", LastRow))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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