+ Reply to Thread
Results 1 to 4 of 4

Inserting blank rows to seperate data by Date

  1. #1
    Registered User
    Join Date
    09-16-2008
    Location
    Ottawa, Canada
    Posts
    29

    Inserting blank rows to seperate data by Date

    I am trying to insert some blank rows into a spreadsheet to break up each section of data.

    I have found a bit of code that works based on a column of text data but it will not work with a column containing dates.

    Please Login or Register  to view this content.
    I keep getting a runtime error 13 on the Elseif line.

    It works fine if I use Column I.

    Column C contains Date/Time (yyyy/mm/dd hh:mm:ss) info and I only want to insert a line based on the Date.
    Any help is appreciated.
    Last edited by Bytor47; 11-17-2011 at 02:12 PM. Reason: Solved

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Inserting blank rows to seperate data by Date

    Hi,

    Not sure why you would get that error, the code should run fine. To split out by date though you would need to use:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

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

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

    Re: Inserting blank rows to seperate data by Date

    Can you attach the sample workbook? I will look into it right away.

  4. #4
    Registered User
    Join Date
    09-16-2008
    Location
    Ottawa, Canada
    Posts
    29

    Re: Inserting blank rows to seperate data by Date

    While putting together the sample spreadsheet, I found that some data in the column was not as expected. I guess it had an issue comparing different data types and that was causing the runtime error.

    I have since fixed up my other code so I have consistant data and this portion works perfectly with the Int() modification.

    Thanks to all for your 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