User-form data extraction RRS feed

  • Question

  • Hello,

      Now I am a bit of a beginner when it comes to VBA and being able to debug my own issues. However the company I work for recently just gave me a long term project of simplifying project with some useful macros. However that is not my issue, I began using user-forms as a way to compile my macros and make it easier for PM's to use. Now I am using a introductory user-form that already opens when starting a new project lets call it "Project planning user-form". Now that we have some background here is my goal with this form, I want the user to be able to enter start-up information, Titles, budgets, milestones, etc. I then want the user form after its closed to automatically pull any information the user had and enter it into the spreadsheet in project. I have only ever made macros and just began using user-forms and I am already confused. Any help will be greatly appreciated and I apologize if my explanation is not clear enough.


    I want my user-forms information from text boxes to automatically copy to my place of choosing, usually the spreadsheet in project or an excel sheet that is open. 

    Wednesday, June 20, 2012 3:44 PM

All replies

  • This is certainly possible. The part that you will need to know is how to find the place to put the data.

    Some project properties are directly addressable.

    For example if you had a textbox on your form for someone to enter the status date, you could have a button to click on the form which writes the value of that text box to the status date like this:

    Private Sub CommandButton1_Click()
    ActiveProject.StatusDate = TextBox1.Value
    End Sub

    The same can be done for almost any property. Using the macro recorder is a good way to find out which property is which and what syntax to use to write to it.

    If you are working with a larger number of tasks you will want to write directly to the tasks. I have a lot of information about this and other topics here:

    but feel free to write back with specific questions.

    Jack Dahlgren blogs at:
    Project and Retrovention
    and rarely Twitter

    Wednesday, June 20, 2012 4:32 PM
  • So does that mean I could write out the code into the unload sequence of my close button, or close and save. What would be really nice is for them to have 2 options, close, and close and save(each with a separate function). "Close" being just an unload command and closing the user-form while the "close and save" (or close and enter) would save the form and input the data into say the first couple lines of the project. This is being used as a start to a project so no tasks have been entered.

    So it would be something like this:

    User starts a new project off my template - User form is activated and presents them with textboxes 

    User inputs data into the text boxes provided lets call them textbox A, B, C  (A= Title, B= Start Date, C= End Date) 

    The user can then click the close and save button and have that data directly inputted into the spreadsheet. 

    ...I wish someone had more referencing of user-forms inside Project, tons of excel ones not very many for project.

    Wednesday, June 20, 2012 6:02 PM