I'm trying to write code to cut and paste a single selected cell into the first blank cell in a specified range (eg H4:H18) but I've been using (xlUp) which isn't returning the desired effect. I don't think (xlUp) is the solution to my problem, but I'm not sure how else to go about it?
Sub TeamA()
Dim TeamRange As Range, TeamNextBlank As Range
Set TeamRange = ActiveSheet.Range("H4:H18")
Set TeamNextBlank = ActiveSheet.Range("H19").End(xlUp)(2)
ActiveCell.Cut Destination:=TeamNextBlank
End Sub
A secondary problem is that if there are no blank cells in the range I need to exit the sub without pasting anything.
Sub TeamA()
Dim TeamRange As Range, TeamNextBlank As Range
Set TeamRange = ActiveSheet.Range("H4:H18")
Set TeamNextBlank = ActiveSheet.Range("H19").End(xlUp)(2)
ActiveCell.Cut Destination:=TeamNextBlank
End Sub
A secondary problem is that if there are no blank cells in the range I need to exit the sub without pasting anything.