+ Reply to Thread
Results 1 to 16 of 16

Excel 2007 : Copy cell to another worksheet if cell starts with a specific string

  1. #1
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Question Copy cell to another worksheet if cell starts with a specific string

    Could you please help?

    I have a worksheet with a lot off different information on it. All the data in the columns are not always of the same type. example: column B contains most of the time text, but sometimes starts with a specific string "tc-"

    I would like to copy the cell if the cell starts with this specific string. Is this possible?

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Copy cell to another worksheet if cell starts with a specific string

    Hi

    You mean, this?

    =IF(LEFT(A1,3)="tc-",A1,"")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: Copy cell to another worksheet if cell starts with a specific string

    Do u want to copy just that cell or the whole row with that data with specific text?

  4. #4
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy cell to another worksheet if cell starts with a specific string

    that's what I also found, but I don't want a new row to be displayed if there is no "tc-". I guess this is only possible with a macro???

  5. #5
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy cell to another worksheet if cell starts with a specific string

    Quote Originally Posted by jraj1106 View Post
    Do u want to copy just that cell or the whole row with that data with specific text?
    I only need that cell

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Copy cell to another worksheet if cell starts with a specific string

    Formula says: If you don't find this "tc-", then don't put anything in ths cell...

    =IF(LEFT(A1,3)="tc-",A1,"")

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

    Re: Copy cell to another worksheet if cell starts with a specific string

    Hi

    Try this:

    copycell.xlsm

  8. #8
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy cell to another worksheet if cell starts with a specific string

    Quote Originally Posted by Fotis1991 View Post
    Formula says: If you don't find this "tc-", then don't put anything in ths cell...

    =IF(LEFT(A1,3)="tc-",A1,"")
    I'll try to explain in another way: In the new worksheet I need a list of all cells starting with ONLY "tc-" and not empty cells.

  9. #9
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy cell to another worksheet if cell starts with a specific string

    Quote Originally Posted by jraj1106 View Post
    Hi

    Try this:

    Attachment 147527

    95% what I need. Is it possible to have an update in stead of adding the values to the list a second time when the macro is run again?

  10. #10
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy cell to another worksheet if cell starts with a specific string

    Quote Originally Posted by jraj1106 View Post
    Hi

    Try this:

    Attachment 147527
    is anyone able to adjust this macro? The list should be updated (do not add a value twice).

    Thanks

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

    Re: Copy cell to another worksheet if cell starts with a specific string

    You can have the list cleared and re-input. This way, no duplicates will be present. Will this work?
    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]

  12. #12
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy cell to another worksheet if cell starts with a specific string

    Quote Originally Posted by arlu1201 View Post
    You can have the list cleared and re-input. This way, no duplicates will be present. Will this work?
    I prefer an update if possible because other data will be put in the same rows and clearing and re-input might mix up the order

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

    Re: Copy cell to another worksheet if cell starts with a specific string

    Is the data in the same rows from other worksheets or the same worksheet? The data in the entire row can be re-input after clearing.

  14. #14
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy cell to another worksheet if cell starts with a specific string

    Quote Originally Posted by arlu1201 View Post
    Is the data in the same rows from other worksheets or the same worksheet? The data in the entire row can be re-input after clearing.
    I'll try to explain: based on the first import I will add a date in the field next to a copied cell. After the re-run of the macro, this date should still be next to the correct cell.

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

    Re: Copy cell to another worksheet if cell starts with a specific string

    Do you have a sample that you can upload?

  16. #16
    Registered User
    Join Date
    03-27-2012
    Location
    België
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy cell to another worksheet if cell starts with a specific string

    I think I made an error in my thinking. This will not be possible.

    Thanks for trying to give me a solution.

+ 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