Greetings
I have a macro that was written for me and it works perfect, however I tried to modify the macro to add two more line to copy and am stuck. Help and advice will be most highly appreciated
the blue shaded area is where I require help with
I need to copy the values from o22:q22 to x18:z18
and the values from t22:v22 to x20:z20
Thank you in anticipation for the help
Regards
raj
I have a macro that was written for me and it works perfect, however I tried to modify the macro to add two more line to copy and am stuck. Help and advice will be most highly appreciated
Rich (BB code):
<code>
Option Explicit
Sub UpdateTable()
Dim LR As Long
With ActiveSheet
If .[C2] = .[C6] And .[D2] = .[D6] And .[E2] = .[E6] And .[F2] = .[F6] Then
MsgBox "It appears the current values have already be entered into row 6. Aborting..."
End
End If
LR = .Range("D" & .Rows.Count).End(xlUp).Row
.Range("C6:F" & LR).Copy
.Range("C7").PasteSpecial xlPasteValues
.Range("C6:F6").Value = .Range("C2:F2").Value
LR = WorksheetFunction.Max(.Range("I" & .Rows.Count).End(xlUp).Row, .Range("J" & .Rows.Count).End(xlUp).Row, .Range("K" & .Rows.Count).End(xlUp).Row)
.Range("I6:K6").Copy
.Range("I7").PasteSpecial xlPasteValues
.Range("I6:K6").Value = .Range("D2:F2").Value
.Range("o18:q18").Value = .Range("D2:F2").Value
.Range("t18:v18").Value = .Range("D2:F2").Value
.Range("x18:z18").Value = .Range("D2:F2").Value
.Range("x19:z19").Value = .Range("o22:q22").Value
.Range("x20:z20").Value = .Range("t22:v22").Value
End With
End Sub</code>
the blue shaded area is where I require help with
I need to copy the values from o22:q22 to x18:z18
and the values from t22:v22 to x20:z20
Thank you in anticipation for the help
Regards
raj
Last edited: