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

    Useform and dubt and prob.... (2000 sr 1)

    In userform is present a button3 it found a value and delete refered value into column of sheet.
    Actually it delete the vlaue in column L and M.

    I have insert in code of userform a new 3 optionbutton.
    If the user select one option button the macro write the value based of one option button.
    Example if i select option1 the macro fill the cells in column L & M, if i select option2 the macro fill the cells in column N & O ecc....

    Now my prob is how to tell to a macro (CommandButton3_Click) to intercept where is the cells and where is the column for deletation?

    Peraphs before deletetion select one option button and after based the option buttoun is selected ...ecc....
    Or pearaphs use a combobox for selection or.... no have idea for this prob.:-(

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

    Re: Useform and dubt and prob.... (2000 sr 1)

    Does this do what you want?

    ...
    If Me.OptionButton1 = True Then
    ELENCO.Cells(FOUND_INDEX, 12).ClearContents
    ELENCO.Cells(FOUND_INDEX, 13).ClearContents
    End If
    If Me.OptionButton2 = True Then
    ELENCO.Cells(FOUND_INDEX, 14).ClearContents
    ELENCO.Cells(FOUND_INDEX, 15).ClearContents
    End If
    If Me.OptionButton3 = True Then
    ELENCO.Cells(FOUND_INDEX, 16).ClearContents
    ELENCO.Cells(FOUND_INDEX, 17).ClearContents
    End If
    ...

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

    Re: Useform and dubt and prob.... (2000 sr 1)

    GOOODDDDDD!!!!
    But before the delete the value i controll with this line if really the cells in refrerence are filled... how to controll based optionbutton?
    this is the line to check...

    If ELENCO.Cells(FOUND_INDEX, 12).Value = "" Then

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

    Re: Useform and dubt and prob.... (2000 sr 1)

    Does it matter? If the cells are not filled, clearing them has no effect.

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

    Re: Useform and dubt and prob.... (2000 sr 1)

    .. yes...
    But how to intercept the cells and column when i decide to delete a notice...
    For insertion you suggest me the line above but for deletection how to intercepet the line? peraph before to use the CommandButton3 require to select a optionbutton.... or have another idea?:
    If Me.OptionButton1 = True Then
    'DOCUMENTI OK
    ELENCO.Cells(FOUND_INDEX, 12).Value = "OK" & "-" & ELENCO.Range("A1")
    ELENCO.Cells(FOUND_INDEX, 13).Value = Format(CDate(Now), "DD/MM/YYYY")
    End If
    If Me.OptionButton2 = True Then
    'DOCUMENTI NON CONFORMI
    ELENCO.Cells(FOUND_INDEX, 14).Value = "KO" & "-" & ELENCO.Range("A1")
    ELENCO.Cells(FOUND_INDEX, 15).Value = Format(CDate(Now), "DD/MM/YYYY")
    End If
    If Me.OptionButton3 = True Then
    'DOCUMENTI ASSENTI
    ELENCO.Cells(FOUND_INDEX, 16).Value = "DA" & "-" & ELENCO.Range("A1")
    ELENCO.Cells(FOUND_INDEX, 17).Value = Format(CDate(Now), "DD/MM/YYYY")
    End If

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

    Re: Useform and dubt and prob.... (2000 sr 1)

    Sorry, I don't understand. You seem to be repeating your earlier question, so apparently I haven't understood it correctly. Can you explain more clearly what you mean?

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

    Re: Useform and dubt and prob.... (2000 sr 1)

    Follow me...with new scenario attached
    Assuming i insert into tesbox txtPart 144208 and press VERIFICA after all box are filled with related value.
    Now if i select optbutton1 and presss cmdAdd the cells L5 and M5 are filled.
    Assuming i insert into tesbox txtPart 144208 and press VERIFICA after all box are filled with related value.
    Now if i select optbutton2 and presss cmdAdd the cells N5 and O5 are filled.
    Assuming i insert into tesbox txtPart 144208 and press VERIFICA after all box are filled with related value.
    Now if i select optbutton3 and presss cmdAdd the cells P5 and Q5 are filled.
    all work fine...

    But, if i insert into tesbox txtPart 144208, if i would want to delete the value into cells L5 and M5
    or i would want to dleted the vlue into cells N5 and O5
    or i would want to dlete the value in cells P5 and Q5 how to intercept this range of 2 cells respect 144208...
    in effect is the same proicess to insert but in reverse mode.....
    hope you now have understand me:-(

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

    Re: Useform and dubt and prob.... (2000 sr 1)

    OK, it's the same question, and so the answer is the same too. See <post:=578,618>post 578,618</post:>.

Posting Permissions

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