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

    Vlookup with caption button (2)

    ho tow to vlookup from each caption button the column O and P in sheet TABELLA and insert the value in column NR. for all textbox...
    example:
    captionbutton = CO4B insert value 25 in textbox51
    captionbutton = MK insert value 48 in textbox46
    captionbutton = ES insert value 10 in textbox54
    ecc...

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

    Re: Vlookup with caption button (2)

    They are called commandbuttons, not caption buttons. Use code like this:

    Private Sub CommandButton13_Click()
    SERV = Trim(CommandButton13.Caption)
    Me.TextBox45 = Application.VLookup(SERV, Worksheets("Tabella").Range("O2:P11"), 2, False)
    Me.TextBox43.SetFocus
    End Sub

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

    Re: Vlookup with caption button (2)

    I am sorry Hans...
    But i want to insert the related value in column NR. in "one shot" in activate or initialize userform event...

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

    Re: Vlookup with caption button (2)

    Simply use a lot of statements like this:

    SERV = Trim(CommandButton13.Caption)
    Me.TextBox45 = Application.VLookup(SERV, Worksheets("Tabella").Range("O2:P11"), 2, False)

    (One pair of statements for each command button/text box combination)

Posting Permissions

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