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

  • Thread starter Thread starter asebes
  • Start date Start date
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.
 
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.
 
Back
Top