+ Reply to Thread
Results 1 to 4 of 4

Transfer userform data to excel sheet

  1. #1
    Forum Contributor
    Join Date
    10-18-2015
    Location
    manila, philippines
    MS-Off Ver
    MS Office 2010
    Posts
    186

    Transfer userform data to excel sheet

    hi experts,

    a little help with my code:

    I am aiming to transfer the data on my textboxes from userform to excel sheet but I am having an error.

    [CODE][/Private Sub CommandButton2_Click()
    lr = Sheets("sheet1").Range("A" & Rows.Count).End(xlUp).Row + 1
    Sheets("Sheet1").Range("A" & lr) = TextBox1
    Sheets("Sheet1").Range("H" & lr) = TextBox2
    Sheets("Sheet1").Range("K" & lr) = TextBox4
    Sheets("Sheet1").Range("E" & lr) = TextBox5
    Sheets("Sheet1").Range("F" & lr) = TextBox6
    TextBox1 = ""
    TextBox2 = ""
    TextBox4 = ""
    TextBox5 = ""
    TextBox6 = ""
    End SubCODE]

    thanks!

  2. #2
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Transfer userform data to excel sheet

    But I did not receive any error at all
    Teach me Excel VBA

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Transfer userform data to excel sheet

    Is the error is that textbox3 is not clearing its data after transfer.If yes just add another line at the end of the code

    Please Login or Register  to view this content.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Transfer userform data to excel sheet

    Hard to say if you don't tell us what the error is and on which line it occurs.
    In the mean time try this.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. code that allow transfer data from userform to sheet
    By mazan2010 in forum Excel Programming / VBA / Macros
    Replies: 42
    Last Post: 01-31-2017, 04:55 PM
  2. Transfer data from userform to a sheet
    By intex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-01-2016, 04:11 PM
  3. transfer data from sheet to another using userform
    By sterio in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2015, 07:52 PM
  4. [SOLVED] Transfer data from a userform to a sheet
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2014, 10:58 AM
  5. combining code to have userform get data from 1 sheet and transfer to another
    By James__S in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2014, 03:26 AM
  6. Transfer data from UserForm to Specific Sheet...
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-07-2013, 10:26 PM
  7. [SOLVED] Match or Loop to Transfer Data from Userform to Sheet
    By cschoyer in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-25-2012, 03:06 PM

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