+ Reply to Thread
Results 1 to 8 of 8

Copy data from textbox1 to column A till end of cell data of column B

  1. #1
    Registered User
    Join Date
    03-04-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Copy data from textbox1 to column A till end of cell data of column B

    Hi everyone,

    I am stuck with an issue.
    I'm creating a program that defines some deadlines to some work and i need to copy the data from textbox1 (company name) till the range of the content data of column B (tasks).
    I will put an example what currently the macro gives me:

    COLUMN A COLUMN B
    TEST COMPANY Submiting Model 22
    Payroll validation
    Encompass update
    Task test
    ...


    And i want to fill the column A with test company till the end of column B data, like this:

    TEST COMPANY Submiting Model 22
    TEST COMPANY Payroll validation
    TEST COMPANY Encompass update
    TEST COMPANY Task test

    this data should not be copy again when i insert another company with diferents taks, for example, inserting another company with the name "Company test 2" i want the data in this figure:


    Column A Column B
    TEST COMPANY Submiting Model 22
    TEST COMPANY Payroll validation
    TEST COMPANY Encompass update
    TEST COMPANY Task test
    Company test 2 Submiting Model 22
    company test 2 Payroll validation
    company test 2 Encompass update
    Company test 2 Task test


    Thanks in advance

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy data from textbox1 to column A till end of cell data of column B

    Do you have a sample file that you can upload?

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    03-04-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy data from textbox1 to column A till end of cell data of column B

    Here it is...
    I want to copy the data from textbox1 from userform3 to sheet ("Clientes Deadline") till the end of the data from the other columns. Now it is working for the 1st insert. When i insert another company, it will copy from the beggining ("A2") to the end... and i dont want it to replace the previous data...

    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy data from textbox1 to column A till end of cell data of column B

    Is the text box 3 having its label as Morada?

    In which column should the value of that textbox be copied?

  5. #5
    Registered User
    Join Date
    03-04-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy data from textbox1 to column A till end of cell data of column B

    Quote Originally Posted by arlu1201 View Post
    Is the text box 3 having its label as Morada?

    In which column should the value of that textbox be copied?
    The data i want to copy is the Textbox1 in the userform3 havings its label as "Nome da entidade".
    The data should be copied to Column A of the sheet "Deadline clientes", till the end of the data from column B of same sheet. However after inserting another company, the data should not replace the previous one.

    Thank you.
    Regards

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy data from textbox1 to column A till end of cell data of column B

    Double click on the Seguinte button and add this code in -
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-04-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy data from textbox1 to column A till end of cell data of column B

    Quote Originally Posted by arlu1201 View Post
    Double click on the Seguinte button and add this code in -
    Please Login or Register  to view this content.
    Thanks! However with that code, as soon i insert another company, the data from colummn A will be replace with the last company name. This is what are doing assuming i enter another company (called "empresa 2") after i enter a company (called "empresa teste") with the same 4 tasks.

    Column A Column B
    Empresa 2 Task A
    Empresa 2 Task B
    Empresa 2 Task C
    Empresa 2 Task D
    Empresa 2 Task A
    Empresa 2 Task B
    Empresa 2 Task C
    Empresa 2 Task D

    I want it that the code gives me this:

    Column A Column B
    Empresa teste Task A
    Empresa teste Task B
    Empresa teste Task C
    Empresa teste Task D
    Empresa 2 Task A
    Empresa 2 Task B
    Empresa 2 Task C
    Empresa 2 Task D

    Best regards,

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy data from textbox1 to column A till end of cell data of column B

    This is because you asked me to consider the last row in column B as the last filled row.

    Change the code to
    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)

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