Results 1 to 16 of 16

Thread: Macro flickering

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    VBAX Regular
    Joined
    Sep 2016
    Posts
    14
    Location
    Your code has For & Next,
    But why Compile error: Says that "Next without For" ?

    Static OldValues As Variant 
    Dim NewValues As Variant 
    Dim Changed As Boolean 
    Dim i As Integer 
    NewValues = Me.Range("T4:T31").Values 
    If Not IsArray(OldValues) Then ' Only true on first run after opening Workbook
        OldValues = NewValues 
    Else 
         For i = LBound(NewValues) To UBound(NewValues) 
            If NewValues(i) <> OldValues(i) Then 
                Changed = True 
                OldValues = NewValues 
                Exit For 
           Next
        End If     
        If Not Changed Then
          Exit Sub
    Last edited by Aussiebear; 04-05-2025 at 03:12 PM.

Posting Permissions

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