Results 1 to 4 of 4

Capture changes to User Form selections when compared to initial inputs

Threaded View

jprlimey Capture changes to User Form... 07-18-2014, 04:08 PM
mehmetcik Re: Capture changes to User... 07-19-2014, 05:54 AM
jprlimey Re: Capture changes to User... 07-19-2014, 12:10 PM
mehmetcik Re: Capture changes to User... 07-22-2014, 05:23 PM
  1. #1
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Question Capture changes to User Form selections when compared to initial inputs

    I'm trying to capture if any changes are made to a UserForms selections.

    I initially load all the data from the database when the first user form is initialized, see code below

    Private Sub Userform_Initialize()
        Dim Sourcewb As Workbook
        Dim myRng As Range
        
        With Me.cbxPlanning
            .ColumnCount = 2
            .ColumnWidths = "12;0"  'hide the second column
            .Clear
            Set Sourcewb = Workbooks.Open("Data Log.xlsx", False, True)
            With Sourcewb.Worksheets(1)
                Set myRng = .Range("A2:BV" & .Cells(.Rows.Count, "A").End(xlUp).Row)    
            End With
            .List = myRng.Value
            Sourcewb.Close False
        End With
    End Sub
    Once I have selected the corresponing record from the combobox , in this case Planning Number, then select the command button which runs the code below

    Private Sub CommandButton1_Click()
    
        Dim myVar As Variant 'String/Long/double???
        Dim myVar1 As String
    
       
        With Me.cbxPlanning
            If .ListIndex > -1 Then
                myVar = .List(.ListIndex, 1) '<-- second column!
                MsgBox myVar  'for testing only
                myVar1 = .List(.ListIndex, 0)
                Select Case myVar
                
                    Case Is = "Standard Process"
                        frmProcessEngineeringTemp.Show
                End Select
                
           End If
        End With
    End Sub
    Now the user form frmProcessEngineeringTemp is opened, it now populates all the comboboxes, textboxes and option buttons in this form based on the planning number choosen from initial user form


    Private Sub Userform_Initialize()
    Dim myVar(1 To 40) As Variant
    
    With frmLoadExistingPlanning.cbxPlanning
            myVar1 = .List(.ListIndex, 0)       'Planning Number
            myVar2 = .List(.ListIndex, 1)       'Product type
            .
            .
            .
            myVar40 = .List(.ListIndex, 51)     'Revision
    End With
    Once the user has finished with the user form the information from the form is passed to a worksheet via a command button. If changes to the user form selections were made i need to capture what has changed (if anything), from what was initially loaded into the second user form (frmProcessEngineeringTemp).

    I have seen numerous posts from various sites that discuss Change and Exit events from a Class module and many instances where each combobox, textbox and option button is hard coded to capture changes.

    Being that I have captured my initial inputs from the database thru the myVar 1 thru 40, can this be put into a string array and the current inputs/selections in the frmProcessEngineeringTemp put into a second array then compare 1 to another looking for difference, then output the differences to a worksheet for tracking purposes. At the same time if changes were indeed made i would increment the Revison record by 1.

    I'm really not sure how to proceed, I'll be honest this is a real challange, well beyond my meager VBA skill sets, any suggestions would be greatly appreciated

    I hope i have provided sufficient information to understand what i'm looking at

    Thanks
    Last edited by jprlimey; 07-23-2014 at 04:25 PM. Reason: Solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Initial Value in a User Form that changes
    By TheSpriceEffect in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2014, 10:27 AM
  2. User form to post data and charts according to user defined selections
    By siroco79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2013, 11:16 AM
  3. VBA: Create User Form That Takes Variable User Inputs
    By sanjeevpandey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2013, 06:14 PM
  4. Store and Retrieve User Inputs from Data Form
    By savio21 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2011, 04:00 PM
  5. Passing inputs from one user form to another
    By daymaker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-18-2011, 11:02 AM

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