Form Combo Boxes to Default to last input row data
Results 1 to 5 of 5

Thread: Form Combo Boxes to Default to last input row data
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jul 2014
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Form Combo Boxes to Default to last input row data

    Hi all,
    this is my first post and I am currently an occasional user of excel - this is my first attempt at Excel VBA
    My question to the forum is this:

    I am using Excel 2007 and would like to create a fairly complex user form that is basically a daily operations report where each row=1 days report. The form works well and updates the excel sheet perfectly.

    My problem is that my daily report uses up to 10 combo boxes that allow the input of team members. I would like for the user NOT to have to keep re-selecting these team members from the combo boxes as they do not change that often. When the form is opened, is there a way to get the combo boxes to default to the previous "days" team members so that they can be re-used into the current days report.

    Is this at all possible?

    Many thanks in advance


    Scott

  2. #2
    MrExcel MVP
    Moderator
    Andrew Poulsom's Avatar
    Join Date
    Jul 2002
    Posts
    73,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Form Combo Boxes to Default to last input row data

    Welcome to MrExcel.

    How would one determine who were the team members for the previous day? How is your data laid out?
    Last edited by Andrew Poulsom; Jul 3rd, 2014 at 03:27 AM.
    Microsoft MVP - Excel

  3. #3
    New Member
    Join Date
    Jul 2014
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Form Combo Boxes to Default to last input row data

    Hi Andrew, thanks for replying. The combo boxes populate specific cells within the sheet: so the team members for the previous day would be in cells 15, 18 and 21 of each row.

    .Cells(iRow, 15).Value = Me.cmbTeam1.Value
    .Cells(iRow, 18).Value = Me.cmbTeam2.Value
    .Cells(iRow, 21).Value = Me.cmbTeam3.Value

  4. #4
    MrExcel MVP
    Moderator
    Andrew Poulsom's Avatar
    Join Date
    Jul 2002
    Posts
    73,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Form Combo Boxes to Default to last input row data

    You can reverse those assignment expressions with an appropriate value for iRow, eg:

    Code:
    Me.cmbTeam1.Value = Cells(iRow, 15).Value
    Microsoft MVP - Excel

  5. #5
    New Member
    Join Date
    Jul 2014
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Form Combo Boxes to Default to last input row data

    Hi Andrew,
    Thank you very much, it worked a treat.

    all the best

    Scott

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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