+ Reply to Thread
Results 1 to 7 of 7

UserForm Retreval, Amend and Return

Hybrid View

Endorphin UserForm Retreval, Amend and... 07-17-2008, 11:24 AM
Leith Ross Hello Endorphin, Here is a... 07-17-2008, 12:14 PM
Endorphin Many Thanks 07-17-2008, 12:25 PM
Leith Ross Hello Neil, Of course,... 07-17-2008, 12:27 PM
Endorphin As I suspected 07-17-2008, 02:42 PM
  1. #1
    Registered User
    Join Date
    10-27-2006
    Posts
    60

    Question UserForm Retreval, Amend and Return

    Hi all,

    Is it possible for a userform to retrieve information from a worksheet, the user to adjust it and then the userform to overwrite the original information?

    Any help really appreciated..

    Endorphin

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Endorphin,

    Here is a simple example. This uses a text box to accept the user's entry, and two command buttons: one to read the data into the text box and the other to write the data back to the cell. You would probably need to added some validation and formatting to this code based on your needs.
    Sub CommandButton1_Click()
     'READ THE DATA
      TextBox1.Text = ActiveSheet.Range("A1")
    End Sub
    
    Sub CommandButton2_Click()
     'WRITE THE DATA
      ActiveSheet.Range("A1") = TextBox1.Value
    End Sub
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    10-27-2006
    Posts
    60

    Many Thanks

    Thank you, atleast I know it can be done. I am only just learning VBA and if I get stuck, could I ask for help on this?

    Neil

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Neil,

    Of course, anytime.

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    10-27-2006
    Posts
    60

    As I suspected

    Hi Leith / Anyone

    Ok, I am now stuck, I have created the document but unable to retrieve the data into the Userform.

    The signal IDs will always be the same.

    1. How do I get the information into the form once I have selected the Signal ID.
    2. If one of the lamp has been changed, I would like to press the “Archive lamp button” and have the newest date move to the old date leaving a space to put the new new date in.
    3. Is there anyway to force excel into opening on the Aspect Data Entry page whatever page it has been saved on.
    Solved this one, see below
    Option Explicit
    Sub Auto_Open()
    Application.Goto ThisWorkbook.Worksheets("Aspect Data Entry").Range("a1"), _
    Scroll:=True
    End Sub
    Again, any help is appreciated.

    Neil
    Attached Files Attached Files
    Last edited by Endorphin; 07-17-2008 at 03:15 PM. Reason: Fixed one Problem

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    use the change event of the combobox

    Private Sub cboPart_Change()
        Dim cl     As Range
        Dim rng    As Range
        Dim sfind  As String
        sfind = Me.cboPart.Text
        With wksPartsData
            Set rng = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
        End With
        With rng
            Set cl = .Find(sfind, LookIn:=xlValues)
            If Not cl Is Nothing Then
                With Me
                    .ROV = cl.Offset(0, 4).Value
                    .YOV = cl.Offset(0, 5).Value
                    'etc
                End With
            End If
        End With
    End Sub
    See attached, I've also simplified the combobox loading

    You also mention using Auto_Open, this code should now be in the WorkBook_Open event.
    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

+ 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