Hello All,
I have the following code which I would like to use to Cut the contents of the active cell, find the first empty cell in a range of rows in the active column. I would like the macro to use the active column and begin searching for an empty cell between rows 22-33 (omitting any empty cells in rows 1-21). The macro below only works if row 22 is blank, it does not search the rest of the range if 22 is not empty. After the empty cell is found I would like it to paste the values and comments only which doesn't seem to be working either. Thanks for the help!
I have the following code which I would like to use to Cut the contents of the active cell, find the first empty cell in a range of rows in the active column. I would like the macro to use the active column and begin searching for an empty cell between rows 22-33 (omitting any empty cells in rows 1-21). The macro below only works if row 22 is blank, it does not search the rest of the range if 22 is not empty. After the empty cell is found I would like it to paste the values and comments only which doesn't seem to be working either. Thanks for the help!
VBA Code:
Sub Macro2()
ActiveCell.Cut
On Error Resume Next
Dim xCell As Range
For Each xCell In ActiveSheet.Cells(22, ActiveCell.Column).Cells
If Len(xCell) = 0 Then
xCell.Select
Exit For
End If
Next
ActiveCell.PasteSpecial (xlPasteComments)
ActiveCell.PasteSpecial (xlPasteValues)
End Sub
Last edited by a moderator: