Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CONDITIONAL INPUT (2000 sr 1)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: CONDITIONAL INPUT (2000 sr 1)

    The code for Worksheet_SelectionChange contains a line

    <code>If c <> "" And Cells(c.Row, 2) = "" Then</code>

    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:

    <code>If c <> "" And Cells(c.Row, 21) = "" Then</code>

    You can also use

    <code>If c <> "" And c.Offset(0, 1) = "" Then</code>

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CONDITIONAL INPUT (2000 sr 1)

    .... 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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: CONDITIONAL INPUT (2000 sr 1)

    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

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CONDITIONAL INPUT (2000 sr 1)

    For ever....Tks

Posting Permissions

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