Hello Team,
This code works Fine
it basically takes the Value of C10 example: 3 and copies whats in F3:Y3
but if that value changes to 5 It clears it and uses the data from F3:Y3
put that value below the range if theres data in the previous rows
There will Be data in F3:Y3 so from the first empty cell from Column F Copy F3:Y3 into the Empty First Cell in Column F but Clear Contents from Empty Cell range F:O
Kinda Like this:
C10 = 3
C10 = 5
Even Adding Rows based on C10 is fine...but it shouldnt delete the previous data from that range. There are some formulas in F:Y that needs to stay..
I hope this makes sense.
This code works Fine
VBA Code:
Dim myR As Range
Set myR = Range("C10")
If Not Intersect(Target, myR) Is Nothing Then
Application.EnableEvents = False
Range("F4:Y4" & Range("F" & Rows.Count).End(xlUp).Row).Offset(0).Clear
On Error Resume Next
If myR.Value >= 1 Then Range("F3:Y3").Copy Destination:=Range("F3:Y3").Resize(myR.Value)
On Error GoTo 0
Application.EnableEvents = True
End If
it basically takes the Value of C10 example: 3 and copies whats in F3:Y3
but if that value changes to 5 It clears it and uses the data from F3:Y3
put that value below the range if theres data in the previous rows
There will Be data in F3:Y3 so from the first empty cell from Column F Copy F3:Y3 into the Empty First Cell in Column F but Clear Contents from Empty Cell range F:O
Kinda Like this:
C10 = 3
C10 = 5
Even Adding Rows based on C10 is fine...but it shouldnt delete the previous data from that range. There are some formulas in F:Y that needs to stay..
I hope this makes sense.