+ Reply to Thread
Results 1 to 6 of 6

Adress Userform

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    206

    Adress Userform

    Hi I am wondering whether you could help me with an excel formulae.

    zie below excel file

    when I do a search and edit from results I get an error. Please help. Thanks.


    With Best regard

    Kirana
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Adress Userform

    Hallo Kirana

    Private Sub ListBox1_Click()
    Dim say As Long, a As Byte, r As Long
    TextBox1 = ListBox1.List(ListBox1.ListIndex, 0)
    ComboBox2 = ListBox1.List(ListBox1.ListIndex, 1)
    For a = 3 To 12
    Controls("textbox" & a) = ListBox1.List(ListBox1.ListIndex, a - 1)
    Next
    Sheets("Data").Range("A:A").Find(ListBox1.Text).Activate
    say = ActiveCell.Row
    Sheets("Data").Range("A" & say & ":M" & say).Select
    TextBox27 = ListBox1.ListIndex + 1
    End Sub
    Kind regards
    Leo

  3. #3
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    206

    Re: Adress Userform

    Dear Leo,

    Private sub listbox1_click() is working but I have one problem with :
    Private Sub CommandButton5_Click() 'Search Button
    Could you please check this for Me

    thank you

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Adress Userform

    There are a couple of things to do
    In your Sub Back() routine, add Dim a as Long between the sub tittle and the For statement
    Also, in your Private Sub CommandButton5_Click() routine, add Dim ctl as Control then replace
    For a = 1 To 13 ' Clear textboxes(1-12)
    Controls("textbox" & a) = ""
    Next
    With
    For Each ctl In Me.Controls
            Select Case TypeName(ctl)
                Case "TextBox"
                    ctl.Value = ""
                Case "ComboBox", "ListBox"
                    ctl.ListIndex = -1
            End Select
        Next ctl
    Last edited by gmr4evr1; 03-27-2016 at 02:34 PM. Reason: Fixed typo in For Each
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  5. #5
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Adress Userform

    Hello Kirana

    in Sub CommandButton5 change this part

    For a = 1 To 13 ' Clear textboxes(1-12)
    Controls("textbox" & a) = ""
    Next
    to
    TextBox1 = ""
    ComboBox2 = ""
    For a = 3 To 13 ' Clear textboxes(3-12)
    Controls("textbox" & a) = ""
    Next
    Kind regards
    Leo

  6. #6
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    206

    Re: Adress Userform

    Hello Leo

    Thank you is working

    well done

    Kirana

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] absolute adress
    By cotix in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-03-2014, 11:27 AM
  2. searching for similar adress
    By samis18 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2013, 04:50 PM
  3. IPv6 Adress Validation
    By madarekrap in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-30-2011, 02:01 PM
  4. How to use ActiveCell Adress in variable?
    By Castor77 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-11-2010, 11:28 AM
  5. iqy query from a web adress?
    By ch0ban in forum Excel General
    Replies: 0
    Last Post: 02-03-2010, 05:44 AM
  6. How to adress columns
    By adiman84 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2008, 03:18 AM
  7. [SOLVED] Try again - adress from a range to combobox
    By alvin Kuiper in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2006, 06:10 PM
  8. [SOLVED] getting the adress on the last row
    By alvin Kuiper in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2006, 12:10 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1