+ Reply to Thread
Results 1 to 8 of 8

Leave destination cells blank when origin cells contain value 0

  1. #1
    Registered User
    Join Date
    09-16-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Leave destination cells blank when origin cells contain value 0

    Hey everyone,

    Im a noob when it comes to programming in excel, but i need a little help with completing the following macro.

    Please Login or Register  to view this content.
    As you can see it's very simple and it works. However some cells in the original range have values of 0. Instead of pasting the value 0 in the destination cells, i would like the macro to leave those blank. I tried using some 'IF' functions but could not get it to work.

    Any help would be greatly appreciated.
    Thanx.
    Last edited by vince2g; 09-16-2010 at 09:29 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Leave destiantion cells blank when origin cells contain value 0

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Re: Leave destiantion cells blank when origin cells contain value 0

    Something Like this should work:

    Please Login or Register  to view this content.
    Last edited by Macdave_19; 09-16-2010 at 11:09 AM. Reason: Didn't see that you want it pasting underneath
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  4. #4
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Re: Leave destiantion cells blank when origin cells contain value 0

    oops you want it pasting underneath don't you see above as i have altered it

  5. #5
    Registered User
    Join Date
    09-16-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Leave destiantion cells blank when origin cells contain value 0

    I had to modify it slightly but it works like a charm.

    Thanx a lot!

    Just a quick question, whats the code to have the selected cells appear unselected when everything is done running.. because at the moment i still get the selection box around range E30:S30.

  6. #6
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Re: Leave destiantion cells blank when origin cells contain value 0

    you just need to select a single cell so something like:

    Please Login or Register  to view this content.
    put that at the end and it will be fine

  7. #7
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Re: Leave destiantion cells blank when origin cells contain value 0

    Feel free to add to my rep by clcick on the scales in the top right

  8. #8
    Registered User
    Join Date
    09-16-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Leave destiantion cells blank when origin cells contain value 0

    Done. Thanx again for the help

+ 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