+ Reply to Thread
Results 1 to 7 of 7

VBA - Macro Code to copy textbox text to another worksheet textbox

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Ashford, England
    MS-Off Ver
    Excel 2007
    Posts
    9

    VBA - Macro Code to copy textbox text to another worksheet textbox

    Macro to copy textbox data to a duplicate textbox in another worksheet



    I have a workbook with two macro enabled worksheets, Sheet1Quotation, Sheet2Acceptance, Sheet2 is a straight copy of Sheet1 i just renamed it as Acceptance, so both are identical apart from the footers on each that do vary, both sheets have six TextBoxes named as TextBox 1 - TextBox 6 again they are of identical size and position on the two sheets. What i want is to automatically fill in the textboxes in sheet 2 as i enter text in the textboxes on sheet 1 to save me having to retype or copy/paste the information again in sheet 2. i use these two forms every day and it would save a lot of time. I have tried varoius methods and codes as suggested by members here and other forums, none work. Would it make a difference if the textboxes were inserted from the shapes sub menu rather that the text sub menu as i think i used that method on inserting some textboxes ? also i have seen some code references which mention "Shapes" in the code as well as the sheet and textbox reference, or would it be easier to have all the text copied to sheet 2 with a command button once sheet 1 boxes are all complete ? HELP.

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: VBA - Macro Code to copy textbox text to another worksheet textbox

    Hi.

    I m not sure if I have understood your problem well. But let me try: You want that when you enter data into the textboxes in sheet1 those should reflect in the textboxes of sheet2 too. I have a code:

    Please Login or Register  to view this content.
    The above will show the data entered in sheet1 textbox in sheet2 textbox too. No button is needed here.
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Registered User
    Join Date
    01-22-2013
    Location
    Ashford, England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: VBA - Macro Code to copy textbox text to another worksheet textbox

    Thanks for the reply, yes you have understood very well, i will give the code a try. where should i place the code ? in the TextBoxSheet Class modules individually or in a general module for the book ?

  4. #4
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: VBA - Macro Code to copy textbox text to another worksheet textbox

    Place this in in sheet1 code section

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Ashford, England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: VBA - Macro Code to copy textbox text to another worksheet textbox

    Hi jraj1106

    i tried the code, entered into Sheet1 VBA code, nothing happens when i enter text in textboses in sheet 1, sheet 2 textboxes remain empty !

  6. #6
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: VBA - Macro Code to copy textbox text to another worksheet textbox

    Have you placed this code for each textboxes in sheet1? When you start typing inside the textbox of sheet1 it has to show the text in the textbox of sheet2.

    If prob persist pls inform me...

  7. #7
    Registered User
    Join Date
    01-22-2013
    Location
    Ashford, England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: VBA - Macro Code to copy textbox text to another worksheet textbox

    i have entered the code, in "sheet1Quotation" (Developer - View Code - VBA sheet opens - Paste Code.) The code shows as a VBA project for sheet1Quotation if i use the "View Code" or "Visual Basic" buttons for Sheet1Quotation, it does not show in "Sheet2Acceptance" which i assume is correct. When i enter text in Sheet1 TextBoxes nothing copies to Sheet2 TextBoxes,

+ 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