Consulting

Results 1 to 7 of 7

Thread: VBA to replace previous table and check if one cells value is equal to the previous o

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Dec 2019
    Posts
    11
    Location

    VBA to replace previous table and check if one cells value is equal to the previous o

    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

    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •