+ Reply to Thread
Results 1 to 7 of 7

VBA form for data entry

  1. #1
    Registered User
    Join Date
    02-27-2017
    Location
    Philaldephia
    MS-Off Ver
    2010
    Posts
    8

    VBA form for data entry

    Hi everyone, I need help building VBA. I have this spreadsheet:

    Contract Rank Performance
    A
    B
    C
    D
    E
    F
    G
    H
    I

    Every month, we need to update the KPI Report for 9 of our contracts. I’m very new with VBA. So far, I’ve created the Data Entry form and 1 code.

    Contract’s combobox’s code is:

    Private Sub UserForm_Initialize()
    Me.ComboBox1.List = Sheets(1).Range("A2:A10").Value
    End Sub

    Q1: Can someone show me how to change the range so that it doesn’t always start at A2 but under the title Contract and it doesn’t always end at A10 so that when we add more contracts the list will show up in the combobox?

    Q2: I also want to rename sheet 1 to Data, how do I write this code as Sheets(Data) instead of Sheets(1)?

    Q3: After choose the contract name on the form, can someone show me a code so that the Rank’s textbox on the form will link to the according cell on the spreadsheet?

    Q4: The Performance column is set up with conditional formatting. Green dot is number 1, Yellow dot is number 2, Red dot is number 3. Can someone show me a code so that when I choose the OptionButton on the form, the right dot will show up on Performance?

    Thanks!
    Attached Images Attached Images

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VBA form for data entry

    Hi, looks good and you've got quite a lot of questions.
    Renaming a sheet just rename it and make sure the code is correct
    Double click the tab and change the text Sheet 1 to Data and do the same in your code Sheets("Data")
    The combobox will always start at 2 but you can make it dynamic and conditional formatting is not recognized in vba bu the formula that decides the coloring yes,

    I suggest you attach a sample file since I don't think you expect any of use to create a workbook for you and try and figure out the userform and all that.
    Attach a file and any one of us can pick it up and help you adding comments in the vba code explaining what does what and when.
    Include the explanation of what you require in the file too.
    Use a Textbox and just type it all in
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA form for data entry

    Hi anhlu

    This can get you started:
    Will populate combobox with values from A2 till last populated row
    Please Login or Register  to view this content.
    Will populate TextBox with the value of ranking dependent on ComboBox1.selection
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Registered User
    Join Date
    02-27-2017
    Location
    Philaldephia
    MS-Off Ver
    2010
    Posts
    8

    Re: VBA form for data entry

    Thanks! Please see attached file.
    Attached Files Attached Files

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA form for data entry

    Hi anhlu

    This solves your first issues...still not sure what you mean by the right dot showing up...but i assumed that it was dependent on the value in your columnP
    Attached Files Attached Files
    Last edited by sintek; 05-08-2017 at 09:31 AM.

  6. #6
    Registered User
    Join Date
    02-27-2017
    Location
    Philaldephia
    MS-Off Ver
    2010
    Posts
    8

    Re: VBA form for data entry

    Thanks Sintek!
    I'm guessing you added codes for column P (Performance) only? I'm very new to VBA so i really don't understand the codes you created but I'm very appreciative of your help!

    My goal is to choose the contract on the form, then enter values for Rank, Renewal Options, Reprocured, Current Term (Start & End), Staffing Level - FTEs, and the values will appear on the correct cells on the spreadsheet.
    For the Retention, Financial Results, Performance, and Customer Satisfaction, I want to choose the color on the form and the right icon will show up.

    Can you review the attached again?

    Many thanks!
    Attached Files Attached Files

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA form for data entry

    This will get you started...i have not done all the optionButtons yet...
    Attached Files Attached Files

+ 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] Data entry form
    By Noushad Vaidyar in forum Excel General
    Replies: 6
    Last Post: 11-06-2013, 01:23 PM
  2. Replies: 3
    Last Post: 09-24-2013, 11:01 AM
  3. Data Entry Form
    By christipper in forum Excel General
    Replies: 3
    Last Post: 07-16-2013, 09:51 AM
  4. Replies: 2
    Last Post: 06-07-2013, 09:08 AM
  5. Data Entry Form
    By roger556 in forum Excel General
    Replies: 4
    Last Post: 11-07-2012, 10:06 PM
  6. [SOLVED] Data Entry form help!
    By skhari in forum Excel General
    Replies: 17
    Last Post: 06-05-2012, 01:21 PM
  7. Excel 2007 : Cannot use data entry form
    By tribalfaery in forum Excel General
    Replies: 1
    Last Post: 06-26-2011, 03:34 AM
  8. Data Entry Form (similar to default Excel Data>Form)
    By tonydm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2005, 02:59 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