+ Reply to Thread
Results 1 to 5 of 5

Excel VBA Userform - Sets of data, View original, add new, edit existing

  1. #1
    Registered User
    Join Date
    01-25-2011
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    2

    Excel VBA Userform - Sets of data, View original, add new, edit existing

    Hi,
    Thankyou for taking the time to look at my post. I am yet another novice user trying to do more than they are capable of.
    I have attached a jpeg of the userform I have created to aid in my description.
    motorcheck.jpg
    This is a database, for adding/viewing annual measurements for a particular conveyor. Each conveyor can have up to 100rows of data in the sheet.
    If a user example clicks on the button C1.01 the worksheet selects row 100. Or if they select button C1.02, the worksheet selects row 200.
    It will then auto-populate the Original/Base Value locked textboxes with the data from the first row (ie row 200).
    The user is then able to add new data, which will add to the next available row (If base row is 200, and row 205 is empty it will add the data there, or row 206 etc).
    The user will also be able to view previous data by pressing the next or previous button, which will move the focus up and down the rows and the unlocked freefield textboxes+checkboxes update with the values from the relevant row and cell. The user can modify existing data and press save.

    So - depending on the row, the userform populates and allows data entry relative to the set of rows the user has selected.
    I have looked at a bunch of examples, and many of them show how to do the normal functions, but i have seen none which are dynamic like this in the sense that it is relevant to a set of rows in the same sheet. I wonder if it is even possible?

    I have also added my workbook, with functional C1 buttons, and example data for C1.01, C1.02, C1.03 (these are the original/base values - there are no new values to input yet).
    MotorCheck.xlsm

    Any ideas will be much appreciated. I hope this thread will help others too. I hope my description is sufficient.
    Thanks again.
    Last edited by newzealdan; 01-27-2011 at 10:59 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel VBA Userform - Sets of data, View original, add new, edit existing

    It's not how I would design the database, but I've added a procedure that can be called by the buttons to load the existing data. Note you do not need to select ranges.
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel VBA Userform - Sets of data, View original, add new, edit existing

    I've amended the code in the first example & added code to submit the amendments to the correct row. You can adapt this to edit, etc
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-25-2011
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Excel VBA Userform - Sets of data, View original, add new, edit existing

    OK Thankyou for your time Roy. I will learn what I can from the expertise you have applied to the workbook :-)

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel VBA Userform - Sets of data, View original, add new, edit existing

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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