+ Reply to Thread
Results 1 to 6 of 6

update table based on the selection in userform

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    update table based on the selection in userform

    hello all...

    a little help please.. i have these whole worksheet which consist of performance scores for several users. all scores are in formula... so this will get a little heavy. sometimes there is a need to change the result of the formula, so i created a userform where i can just add the score i want for a specific user in a specific week. unfortunately that is how far my knowledge of macro goes.

    need your help to ensure that when i click on add button, the score would be updated to the right user, right week and right KPI? row 3 contains the week number while column A and D has the APM ID and KPI. note thet this only a sample data... the real file would contain much more rows.

    appreciate your help in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: update table based on the selection in userform

    Hi melody

    This should work for your Add Button (no error checking)...
    Private Sub CommandButton1_Click()
       Dim ws           As Worksheet
       Dim cNo          As Long
       Set ws = Sheets("Sheet1")
       With ws.Columns(1)
          Set c = .Find(Me.TextBox2.Value, LookIn:=xlValues)
          If Not c Is Nothing Then
             firstAddress = c.Address
             Do
                If c.Offset(0, 3).Value = Me.ComboBox1.Value Then
                   cNo = Rows(3).Find(Me.TextBox1.Value, LookAt:=xlWhole).Column
                   .Cells(c.Row, cNo) = Me.TextBox3.Value
                   Exit Do
                End If
                Set c = .FindNext(c)
             Loop While Not c Is Nothing And c.Address <> firstAddress
          End If
       End With
    End Sub
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: update table based on the selection in userform

    that wasfast can you also help on reset and close button?

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: update table based on the selection in userform

    Hi melody

    Close Button:
    Private Sub CommandButton3_Click()
       Unload Me
    End Sub
    Reset Button:
    Private Sub CommandButton2_Click()
       Me.ComboBox1.ListIndex = -1
       Me.TextBox1.Value = ""
       Me.TextBox2.Value = ""
       Me.TextBox3.Value = ""
    End Sub

  5. #5
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: update table based on the selection in userform

    thank you... thank you.. thank you...

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: update table based on the selection in userform

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. Trying to update an access table from Excel based on unique ID. rst.Update not working
    By Newbie0924 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2015, 04:15 PM
  2. [SOLVED] Select date userform based on Userform selection
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-07-2014, 10:45 AM
  3. Update formula in cells based on list selection
    By XLNB in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-05-2014, 03:39 PM
  4. [SOLVED] How to update form label caption based off selection
    By cameron213 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2014, 03:22 PM
  5. Update excel based on userform text box update
    By sivakumar123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2013, 01:01 AM
  6. Update List of Fixtures based on Selection
    By mccrimmon in forum Excel General
    Replies: 2
    Last Post: 06-10-2011, 10:53 AM
  7. Update formula based on cell selection
    By Maver1ck666 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-01-2010, 09:49 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