• CONDITIONAL INPUT (2000 sr 1)

    Author
    Topic
    #406352

    I have modify and old macro….

    this controll:

    if in cell of column T7 is present “something” force the cell U7 for input
    if i delete in the cell T7 “something”, the condition not exisit , are you free for new input

    but i have insert a “something” in T7 and date in U7, the condition still exist????? and i am not free for new input.

    a litle correction please

    Viewing 1 reply thread
    Author
    Replies
    • #841922

      The code for Worksheet_SelectionChange contains a line

      If c "" And Cells(c.Row, 2) = "" Then

      Cells(c.Row, 2) is a cell in the second column, i.e. column B. You want to check column U, not B. So you must change 2 to 21:

      If c "" And Cells(c.Row, 21) = "" Then

      You can also use

      If c "" And c.Offset(0, 1) = "" Then

      • #841926

        …. only you! iI not me mistake uou are…. (WIZARD)

        1 question

        but if i delete the what is present in T7 is possible to deleta automativcly what is present in U7?
        and make this new codition in the range T7:T1500

        • #841931

          You already have code for the Worksheet_SelectionChange event. In the same module, add the following code for the Worksheet_Change event:

          Private Sub Worksheet_Change(ByVal Target As Range)
          Dim c As Range
          If Not Intersect(Target, Range(“T7:T5100”)) Is Nothing Then
          For Each c In Intersect(Target, Range(“T7:T5100”))
          If c.Value = “” Then
          c.Offset(0, 1).ClearContents
          End If
          Next c
          End If
          Set c = Nothing
          End Sub

        • #841932

          You already have code for the Worksheet_SelectionChange event. In the same module, add the following code for the Worksheet_Change event:

          Private Sub Worksheet_Change(ByVal Target As Range)
          Dim c As Range
          If Not Intersect(Target, Range(“T7:T5100”)) Is Nothing Then
          For Each c In Intersect(Target, Range(“T7:T5100”))
          If c.Value = “” Then
          c.Offset(0, 1).ClearContents
          End If
          Next c
          End If
          Set c = Nothing
          End Sub

    • #841923

      The code for Worksheet_SelectionChange contains a line

      If c "" And Cells(c.Row, 2) = "" Then

      Cells(c.Row, 2) is a cell in the second column, i.e. column B. You want to check column U, not B. So you must change 2 to 21:

      If c "" And Cells(c.Row, 21) = "" Then

      You can also use

      If c "" And c.Offset(0, 1) = "" Then

    Viewing 1 reply thread
    Reply To: CONDITIONAL INPUT (2000 sr 1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: