+ Reply to Thread
Results 1 to 3 of 3

Copy cell contents as is unless contains text in which case replace

  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    MT, Malta
    MS-Off Ver
    Excel 2013
    Posts
    2

    Copy cell contents as is unless contains text in which case replace

    HI guys my first post here, I have I think an easy one.

    I have contents in cells A1-Z10. These cells have a numerical value or a text value (either DNS or DNB). I want to copy the contents of these cells to A11-Z20 based on the conditions:

    If cell A1-Z10 has a numerical value, copy as is;
    If cell A1-Z10 contains the text DNS or DNB, replace with 0.

    Any help appreciated.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Copy cell contents as is unless contains text in which case replace

    in A11
    =IF(OR(A1="DNS",A1="DNB"),0,A1)
    copy across and down as far as Z20

    NOTE: This new data is still dependent on the data in A1:Z10.
    If you're going to delete A1:Z10 you will need to copy/paste values on the A11:Z20 range before deleting A1:Z10
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    03-12-2013
    Location
    MT, Malta
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Copy cell contents as is unless contains text in which case replace

    Thanks, works perfectly

+ 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: 6
    Last Post: 04-21-2016, 02:15 PM
  2. Macro text replace with Cell contents
    By grezmel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2015, 09:59 AM
  3. Find and Replace the contents of one cell with the contents of another
    By thechevs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2014, 06:48 AM
  4. Replies: 0
    Last Post: 02-01-2014, 09:52 AM
  5. [SOLVED] Macro to copy cell contents then used Find & Replace to put text elswhere.
    By AimeeNZ in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-12-2012, 01:06 AM
  6. Copy contents of cell and paste in text box
    By Ricardo9211 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2009, 01:02 AM
  7. [SOLVED] Can I copy cell contents to an autoshape as text using a macro?
    By Syndrome in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 01:35 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