+ Reply to Thread
Results 1 to 4 of 4

data entry to multy sheet using userform

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2007
    Posts
    17

    data entry to multy sheet using userform

    i am using this code for data entry to sheet1 by userform. i need the same data in sheet7 also..
    what changes i want to make in code?

    Private Sub CommandButton1_Click()
    Dim irow As Long
    Dim ws As Worksheet
    Set ws = Worksheets("Sheet1")
    'find first row in database
    irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    With ws
    .Range("A" & irow) = TextBox1.Value
    .Range("B" & irow) = TextBox2.Value
    .Range("C" & irow) = TextBox3.Value
    End With
    TextBox1.Value = ""
    TextBox2.Value = ""
    TextBox3.Value = ""

    End Sub

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: data entry to multy sheet using userform

    You could use this code:
    Please Login or Register  to view this content.
    or also this:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: data entry to multy sheet using userform

    Its coming only sheet7

  4. #4
    Registered User
    Join Date
    01-25-2013
    Location
    saudi arabia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: data entry to multy sheet using userform

    here am retrieving the data from sheet1 to userform then send it to sheet2 , i want to send to sheet7 also
    here below the code for userfrm am using now

    Private Sub cmdCancel_Click()
    'Unload the userform
    Unload Me
    End Sub

    Private Sub cmdOkay_Click()
    Dim irow As Long
    Dim ws As Worksheet
    Set ws = Worksheets("Sheet2")
    'find first row in database
    irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    With ws
    .Range("A" & irow) = TextBox1.Value
    .Range("B" & irow) = TextBox2.Value
    .Range("C" & irow) = TextBox3.Value
    .Range("D" & irow) = TextBox4.Value
    End With
    TextBox1.Value = ""
    TextBox2.Value = ""
    TextBox3.Value = ""
    TextBox4.Value = ""
    End Sub

    Private Sub ComboBox1_Change()

    'vRange = "A1:C" & Cells(Rows.Count, "A").End(xlUp).Row
    vRange = "FirstField"
    TextBox1.Text = Application.VLookup(ComboBox1.Value, Sheets("Sheet1").Range(vRange), 1, False)
    TextBox2.Text = Application.VLookup(ComboBox1.Value, Sheets("Sheet1").Range(vRange), 2, False)
    TextBox3.Text = Application.VLookup(ComboBox1.Value, Sheets("Sheet1").Range(vRange), 3, False)
    End Sub




    Private Sub Label3_Click()

    End Sub

    Private Sub UserForm_Initialize()

    'UserForm1.ComboBox1.RowSource = "A2:C" & Cells(Rows.Count, "A").End(xlUp).Row
    UserForm1.ComboBox1.RowSource = "FirstField"
    End Sub

+ 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