+ Reply to Thread
Results 1 to 3 of 3

Userform calls other userform, then populate worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    06-15-2013
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    17

    Userform calls other userform, then populate worksheet

    Hello all

    I am working in a soccer results spreadsheet, but I am stuck with a data entry userform. I tried many ways and always results in fails.

    Anyone can help me to find a solution to this please?

    I attached the spreadsheet with the userforms but no code , just the userform interface and some comments to explain the idea.

    Thank you very much in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Userform calls other userform, then populate worksheet

    Try this Userform.



    
    Private Sub UserForm_Activate()
    
    For i = 1 To ActiveWorkbook.Sheets.Count
    
    TN = ActiveWorkbook.Sheets(i).Name
    
    If TN = "Main" Or TN = "Useful Code" Or TN = MyTeam Then GoTo Skip
    Flag = 0
    
    ComboBox1.AddItem ActiveWorkbook.Sheets(i).Name
    ComboBox2.AddItem ActiveWorkbook.Sheets(i).Name
    
    Skip:
    
    Next i
    End Sub
    
    Private Sub Loader()
    If ComboBox1.Value = "" Or ComboBox2.Value = "" Then Exit Sub
    
    With Sheets(ComboBox1.Value)
    On Error Resume Next
    Set Z = .Columns(1).Find(ComboBox2.Value, LookIn:=xlValues, Lookat:=xlWhole)
    t = Z.Row
    If t > 0 Then
    For Count = 1 To 4
    Me.Controls("Textbox" & Count).Text = .Cells(t, Count + 1).Value
    Next
    End If
    
    Adder
    
    On Error GoTo 0
    End With
    
    End Sub
    
    Private Sub Adder()
    If Changeflag = True Then Exit Sub
    For Count = 1 To 4
    If Me.Controls("Textbox" & Count).Text = "" Then Me.Controls("Textbox" & Count).Text = "0"
    Next
    
    TextBox5.Value = TextBox1.Value * 1 + TextBox3.Value * 1
    TextBox6.Value = TextBox2.Value * 1 + TextBox4.Value * 1
    End Sub


    Change this line above.
    If TN = "Main" Or TN = "Useful Code" Or TN = MyTeam Then GoTo Skip

    To

    If TN = "Main" Or TN = "Useful Code" Then GoTo Skip

    To avoid confusing yourself.

    I was going to use MyTeam to create the Userform as you described it.
    But then i decided that your solution was over complicated and sarted again.
    Attached Files Attached Files
    Last edited by mehmetcik; 02-03-2016 at 07:50 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    06-15-2013
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Userform calls other userform, then populate worksheet

    I am really grateful for your help, really.
    I will study the code because I want to learn, but it's complicated for me at this moment, step by step
    Thanks mehmetcik !!!!!!!!!!

+ 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. Possible to use a Userform to populate cells on worksheet like a database?
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2015, 01:11 PM
  2. Trying to populate a userform combobox from a userform textbox
    By jtemp57 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2014, 03:33 PM
  3. UserForm to populate multiple rows in a Worksheet
    By clapforthewolfman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2013, 01:11 PM
  4. [SOLVED] vba userform calendar to populate textbox in another userform
    By kaurka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-29-2012, 01:43 PM
  5. Creating a database on a worksheet to populate a userform
    By bclacquer in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-11-2010, 04:53 PM
  6. How do I get a UserForm to populate the next empty row in a worksheet?
    By JustinMAS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2008, 02:43 AM
  7. [SOLVED] Looping procedure calls userform; how to exit loop (via userform button)?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2005, 08:05 AM

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