Hello I am trying to create a vba code that if there is a value or text in a specific cell (Starting with C100 to C105) then it would drag down the entire formula in one row to the next cell thats been populated until no cells in that range has value. This is what i have currently, i feel like i need to make thes range more dynamic based on the range in the variable X but not really sure how to do it. appreciate all of the help!
Sub Test ()
Dim x As Range
For Each x In Range ("C100:C105")
If IsEmpty (x) Then
Else
Range("D99:WP99").Select
Selection.AutoFill Destination:=Range("D99:WP100"), Type:=xlFillDefault
Range("D99:WP100").Select
End If
Next x
End Sub
Sub Test ()
Dim x As Range
For Each x In Range ("C100:C105")
If IsEmpty (x) Then
Else
Range("D99:WP99").Select
Selection.AutoFill Destination:=Range("D99:WP100"), Type:=xlFillDefault
Range("D99:WP100").Select
End If
Next x
End Sub