baxius
12-06-2019, 09:26 AM
Hello,
I couldn't figure it out on my own so i decided to turn to the professionals.
I have a Macro in which if a value is entered in a cell right of the table, the table values ,formulas,format from above is copied right below the old one. Now the thing i need is that one of the copied cells would check if it is the same value from the previous table and create pop up: New value (or at least change it's colour). To put it simply i attached a workbook and the whole code. IF a value is entered in G column. The previous cells are copied and pasted nearby. What is need is when a new table is created, to check if (For this instance) B24=B35 and if not create a Message box or at least change it's colour. Thank you for any tips or help.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Target.Cells(1, 1)
If Len(r.Value) = 0 Then Exit Sub
If r.Column <> 7 Then Exit Sub
If r.Row Mod 11 <> 1 Then Exit Sub
r.Offset(-11, -6).Resize(11, 5).Copy r.Offset(0, -6)
End Sub
I couldn't figure it out on my own so i decided to turn to the professionals.
I have a Macro in which if a value is entered in a cell right of the table, the table values ,formulas,format from above is copied right below the old one. Now the thing i need is that one of the copied cells would check if it is the same value from the previous table and create pop up: New value (or at least change it's colour). To put it simply i attached a workbook and the whole code. IF a value is entered in G column. The previous cells are copied and pasted nearby. What is need is when a new table is created, to check if (For this instance) B24=B35 and if not create a Message box or at least change it's colour. Thank you for any tips or help.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Target.Cells(1, 1)
If Len(r.Value) = 0 Then Exit Sub
If r.Column <> 7 Then Exit Sub
If r.Row Mod 11 <> 1 Then Exit Sub
r.Offset(-11, -6).Resize(11, 5).Copy r.Offset(0, -6)
End Sub