+ Reply to Thread
Results 1 to 5 of 5

how to enter data into cells through vba forms

  1. #1
    Registered User
    Join Date
    09-04-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    25

    how to enter data into cells through vba forms

    I have this worksheet that has two columns, one labelled Month and the other labelled Number. I also have a form that allow me to enter the data into the worksheets under the two columns by clicking a button called "add". But what I want to do now is by clicking on another button called "End" I will be able to enter 3 rows under the data I've inserted into the worksheets with the name "min", "max" and "aver", this is what I have:

    Please Login or Register  to view this content.
    however this code only inserts the "Aver" under the data, but the Min and Max is no where to be found.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: how to enter data into cells through vba forms

    You are writing all three values in the cell Cells(jRow, 1)

    Maybe try this:

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    09-04-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: how to enter data into cells through vba forms

    Quote Originally Posted by abousetta View Post
    You are writing all three values in the cell Cells(jRow, 1)

    Maybe try this:

    Please Login or Register  to view this content.
    abousetta
    Thanks that worked well! I have one more question, what I want to do now is calculate the minimum, maximum and average for the Number column(column B), I need to calculate them by using the data I entered through the forms, the problem is there's no fix amount of numbers that the user will enter so I can't determine a fixed range eg average of B2:B9, so is there a way that I could find the min, max and average of the numbers the user entered via the form into the cells? So I'll have something like this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-04-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: how to enter data into cells through vba forms

    Update: I managed to figure out how to do the Min and Max, now trying on Average.

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: how to enter data into cells through vba forms

    Off the top of my head, I would try:

    Please Login or Register  to view this content.
    This should put a formulas in each cell for Min, Max and Aver, but they will be volatile (in other words they will update each time you add new data.

    If you want it to only calculate at the moment of submission and leave only the value then you might want something like:

    Please Login or Register  to view this content.
    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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