+ Reply to Thread
Results 1 to 3 of 3

Send TextBox to 2 sheets

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    Jordan
    MS-Off Ver
    Excel 2010
    Posts
    77

    Post Send TextBox to 2 sheets

    I have workbook with 17 sheets ..
    I've build a userform
    But when another sheet is active, the userform doesn't work ...
    1- how to make it write and read from a specific sheet ??
    2- at the same time , how to make TextBox1.Text to be saved at Sheet5 (A5) ?
    3- How to set the ComboText data to read from specific sheet ?


    Private Sub AddAndNew_Click()


    Dim LastRow As Object

    Set LastRow = Sheet1.Range("a65536").End(xlUp)

    LastRow.Offset(1, 0).Value = TextBox1.Text
    LastRow.Offset(1, 1).Value = TextBox2.Text
    LastRow.Offset(1, 2).Value = TextBox3.Text
    LastRow.Offset(1, 3).Value = TextBox4.Text
    LastRow.Offset(1, 4).Value = TextBox5.Text
    LastRow.Offset(1, 5).Value = TextBox6.Text
    LastRow.Offset(1, 6).Value = TextBox7.Text
    LastRow.Offset(1, 7).Value = TextBox8.Text
    LastRow.Offset(1, 8).Value = ComboBox9.Text
    LastRow.Offset(1, 9).Value = TextBox10.Text
    LastRow.Offset(1, 10).Value = TextBox11.Text
    LastRow.Offset(1, 11).Value = TextBox12.Text
    LastRow.Offset(1, 12).Value = TextBox13.Text
    LastRow.Offset(1, 13).Value = TextBox14.Text
    LastRow.Offset(1, 14).Value = TextBox15.Text
    LastRow.Offset(1, 15).Value = TextBox16.Text
    LastRow.Offset(1, 16).Value = TextBox17.Text
    LastRow.Offset(1, 17).Value = ComboBox18.Text
    LastRow.Offset(1, 18).Value = TextBox19.Text
    LastRow.Offset(1, 19).Value = TextBox20.Text
    LastRow.Offset(1, 20).Value = ComboBox21.Text
    LastRow.Offset(1, 21).Value = TextBox22.Text
    LastRow.Offset(1, 22).Value = TextBox23.Text
    LastRow.Offset(1, 23).Value = TextBox24.Text
    LastRow.Offset(1, 24).Value = TextBox25.Text
    LastRow.Offset(1, 25).Value = TextBox26.Text


    MsgBox "One record written to Contacts Information"

    response = MsgBox("Do you want to enter another record?", _
    vbYesNo)

    If response = vbYes Then
    TextBox1.Text = ""
    TextBox2.Text = ""
    TextBox3.Text = ""
    TextBox4.Text = ""
    TextBox5.Text = ""
    TextBox6.Text = ""
    TextBox7.Text = ""
    TextBox8.Text = ""
    ComboBox9.Text = ""
    TextBox10.Text = ""
    TextBox11.Text = ""
    TextBox12.Text = ""
    TextBox13.Text = ""
    TextBox14.Text = ""
    TextBox15.Text = ""
    TextBox16.Text = ""
    TextBox17.Text = ""
    ComboBox18.Text = ""
    TextBox19.Text = ""
    TextBox20.Text = ""
    ComboBox21.Text = ""
    TextBox22.Text = ""
    TextBox23.Text = ""
    TextBox24.Text = ""
    TextBox25.Text = ""
    TextBox26.Text = ""

    TextBox1.SetFocus

    Else
    Unload Me
    End If


    '****
    End Sub
    Last edited by Shacker; 04-24-2013 at 09:59 AM.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Send TextBox to 2 sheets

    This is in need of a sample workbook. Post one if you can.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    04-23-2013
    Location
    Jordan
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Send TextBox to 2 sheets

    Attachment herehttp://www.excelforum.com/excel-prog...11#post3211311

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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