+ Reply to Thread
Results 1 to 5 of 5

Macro to insert a rage of cells deletes previous content if range is blank

  1. #1
    Registered User
    Join Date
    04-26-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    31

    Macro to insert a rage of cells deletes previous content if range is blank

    Hi All, I have a macro in a rostering worksheet which copies overtime details in a range of data,("E8:H22") to another area of a worksheet ("Q100"), then adds the date from ("C6"), deletes blank rows and copies cells with data and inserts it at ("P8:T8"), this works fine if there is content in the cells however if there is nothing to insert it deletes previous content. The way I am doing this is probably taking the long way around, ideally I would like to be able to copy the details directly under ("P8:T8") with date, but I would be happy to know how to have the macro stop copying to ("P8:T8") if there is no content and move on. Thanks in advance, Ed


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    04-26-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Macro to insert a rage of cells deletes previous content if range is blank

    Hi All here is the sample file: Returns.xls

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to insert a rage of cells deletes previous content if range is blank

    see your other post

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to insert a rage of cells deletes previous content if range is blank

    Hi ed,

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Registered User
    Join Date
    04-26-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Macro to insert a rage of cells deletes previous content if range is blank

    Hi folks, sorry for the duplication and confusion I had difficulty attaching my sample file. In the interim I came up with a solution of my own which works (and I understand), I will study your suggestions. I appreciate all your assistance. Thanks very much, Ed.

    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)

Similar Threads

  1. [SOLVED] Macro to insert a rage of cells deletes previous content if range is blank
    By 54ed in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-24-2014, 12:01 AM
  2. Help with Code That Searches for a Blank Row and Deletes it within a Range
    By b0ttle in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2014, 03:57 PM
  3. Macro for adding blank cells based on previous data
    By kelcomel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2010, 12:41 PM
  4. [SOLVED] How to create a macro that deletes every blank row in a spreadshee
    By Grd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2005, 06:50 PM
  5. RE: How to create a macro that deletes every blank row in a spread
    By Grd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2005, 06: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