+ Reply to Thread
Results 1 to 9 of 9

Don't copy cell if certain text

  1. #1
    Registered User
    Join Date
    02-12-2016
    Location
    Zurich, Switzerland
    MS-Off Ver
    MS Office 2013
    Posts
    94

    Don't copy cell if certain text

    Hi everyone,

    I have the following code:

    Please Login or Register  to view this content.
    It copies from cell J1 to C6.

    Now I want to alter the code so that it doesn't copy the data from J1 to C6 if the J1 has the text "00.01.1900" in it. In all other cases it should still copy as usual. How can I do that?

    In advance many thanks for your help!

  2. #2
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Don't copy cell if certain text

    From the record code, it seems that you have copied J1 and J2 but you want the condition only for J1, is it right?

    If the code helped you, please add reputation to me "*"

    Try this,
    Please Login or Register  to view this content.
    Last edited by Faridwahidi; 03-03-2016 at 11:42 AM.
    1. Thank those who have helped you by clicking the Star * below the post.
    2. Please mark your post [SOLVED] if it has been answered satisfactorily.

    Sincerely,
    Farid

  3. #3
    Registered User
    Join Date
    02-12-2016
    Location
    Zurich, Switzerland
    MS-Off Ver
    MS Office 2013
    Posts
    94

    Re: Don't copy cell if certain text

    Thanks for your help!

    Actually, I would like for J1 and J2. So if there is the value 00.01.1900 in J1 and J2 it should leave the cells C6 and D6 blank.

    Unfortunately, your code didn't help.

  4. #4
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Don't copy cell if certain text

    just add condition to J2

    Please Login or Register  to view this content.
    If the code helped you, please add reputation to me "*"

  5. #5
    Registered User
    Join Date
    02-12-2016
    Location
    Zurich, Switzerland
    MS-Off Ver
    MS Office 2013
    Posts
    94

    Re: Don't copy cell if certain text

    It still copies over the values. Do you have any other ideas?

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Don't copy cell if certain text

    Hello etaver87,

    Maybe:
    Please Login or Register  to view this content.
    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  7. #7
    Registered User
    Join Date
    02-12-2016
    Location
    Zurich, Switzerland
    MS-Off Ver
    MS Office 2013
    Posts
    94

    Re: Don't copy cell if certain text

    Fantastic, it worked like Faridwahidi suggested but with Text instead of Value!

  8. #8
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Don't copy cell if certain text

    try change it to .text

    Please Login or Register  to view this content.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Don't copy cell if certain text

    Hi etaver87,

    Glad I could assist solving your issue with a different approach.

    Thank you for adding to my Reputation.

    If that took care of your original question, and if you have managed to solve your issue please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Thanks.

    Regards.

+ 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. Replies: 2
    Last Post: 10-24-2014, 12:12 PM
  2. [SOLVED] Copy any bold text within a cell text string to an adjacent cell
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-31-2014, 06:22 PM
  3. Replies: 11
    Last Post: 05-23-2014, 06:41 AM
  4. Replies: 1
    Last Post: 12-10-2013, 05:23 PM
  5. Replies: 1
    Last Post: 11-05-2012, 09:23 PM
  6. [SOLVED] Macro to Copy Cell Text and Copy to a Text Box
    By Daniel1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2012, 08:59 AM
  7. open some txt files ,find text , copy the text before that to a single cell
    By gus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2005, 01:05 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