Advertisement
nordscan

Ak sa zmeni G vymaze sa H

Jun 19th, 2023
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.     ' Overenie ci bola zmenena hodnota v stlpci G
  3.    If Not Intersect(Target, Columns("G")) Is Nothing Then
  4.         Application.EnableEvents = False ' Vypne udalosti aby sme sa vyhli rekurzii
  5.        On Error GoTo ErrorHandler ' Osetrenie chyb
  6.        ' Vymazanie hodnoty v prislusnom riadku stlpca H
  7.        Range("H" & Target.Row).ClearContents
  8. ErrorHandler:
  9.         Application.EnableEvents = True ' Zapne udalosti späť
  10.    End If
  11. End Sub
  12.  
Tags: vba
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement