+ Reply to Thread
Results 1 to 5 of 5

Saving textbox data from a userform to Sheet2 cells...

  1. #1
    Registered User
    Join Date
    10-25-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Question Saving textbox data from a userform to Sheet2 cells...

    I have a macro that formats "Sheet2" from data in Sheet1 and then launches a user form (UserForm1). From UserForm1 there are (4) textboxes and each one of these text boxes would need to save the data within either 3 or 4 times each. TextBox1 and TextBox2 would need to be saved (4) times. TextBox3 and TextBox4 would need to saved (3) times into the respective cells in Sheet2.

    i.e.
    PCRLocation - PCR1 (saved 4 times F2:F5)
    PCR Plate ID - 119416 (saved 4 times G2:G5)
    Source ID - J93174_001 (saved 3 times H2:H4)
    DNASource ID - DNA1 (saved 3 times J2:J4)

    I have been able to code it to save to the correct cells, but not in replicates. Does anyone know how to approach this?? I cannot seem to get this to work at all.

    Currently the code for UserForm1 is as shown below:

    Please Login or Register  to view this content.
    Second question, right now there is no code to decifer if the text boxes are filled with data out of the order listed on Sheet2, but if there is a way to associate the text box data with a specific common name so the save starts at the right row that would be ideal. Currently the saves start at Row2 ColumnF (first empty cell). The ideal would be if a user wants to start with lets say PCR Location (PCR4) they could and the macro would know to start with that row (line 14 on Sheet2) from Sheet2 for saving those records.

    Is it possible to code the macro to save with row association? If so please help.

    Thanks in advance,

    J.
    Last edited by goldbeje; 09-05-2012 at 02:43 PM.

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Saving textbox data from a userform to Sheet2 cells...

    pay Your attention on this part
    Please Login or Register  to view this content.
    Let's say irow=3, so if you want to save value of TextBox1 into cells "H3:J3" you can use this
    Please Login or Register  to view this content.
    and for rows offset
    Please Login or Register  to view this content.
    Last edited by MaczaQ; 09-04-2012 at 03:53 PM.
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  3. #3
    Registered User
    Join Date
    10-25-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Saving textbox data from a userform to Sheet2 cells...

    Hi MaczaQ!

    Thank you for your response. What I am trying to do is when a user puts data into TextBox1 "J93714_001".. I want that to save to Sheet2 in Cells H2:H4 from one single input on the userform textbox.

    For TextBox2 "DNA1" same thing but for range of copies to be in J2:J4

    So it would look like the below on Sheet2:

    Row H Row J
    Row 2 J93714_001 DNA1
    Row 3 J93714_001 DNA1
    Row 4 J93714_001 DNA1

    Are you familiar with doing this??

    Thanks.

  4. #4
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Saving textbox data from a userform to Sheet2 cells...

    so try update your code in this way
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-25-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Saving textbox data from a userform to Sheet2 cells...

    Thank you for your assistance.. I figured out what I needed.
    I went in the direction below:

    Please Login or Register  to view this content.

+ 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