macro that will paste a number in first blank cell of a column

A

asebes

I would like to create a formula or macro that will take a number that always
comes from the same cell but then pastes that information in the first blank
cell within a column.
 
G

Gary''s Student

Select the cell you want to copy and run this macro:

Sub PlaceIt()
Set r = Selection
v = r.Value
For Each cell In Range("F:F")
If cell.Value = "" Then
cell.Value = v
Exit Sub
End If
Next
End Sub

The code uses column F, but you can change it. If you click on a cell, say
B9, and run the macro, then value in B9 will be pasted to the first cell in
column F that is blank.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top