Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-01-2015, 05:48 AM
macropod's Avatar
macropod macropod is online now how to list missing all date by blank row between change value cells? Windows 7 64bit how to list missing all date by blank row between change value cells? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:


Code:
Sub Demo()
Application.ScreenUpdating = False
Dim lRow As Long, lCol As Long, i As Long, j As Long
With ActiveWorkbook.ActiveSheet.UsedRange
  lRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
  lCol = .Cells.SpecialCells(xlCellTypeLastCell).Column
  For i = lRow - 1 To 2 Step -1
    If .Range("B" & i + 1).Value = 0 Then
    ElseIf .Range("B" & i).Value = 0 Then
    Else
      j = .Range("B" & i + 1).Value - .Range("B" & i).Value - 1
      If j > 0 Then
        .Range(.Cells(i + 1, 1), .Cells(i + j, lCol)).Insert Shift:=xlShiftDown
      End If
    End If
  Next
  j = Format(.Range("B2").Value, "dd")
  If j > 1 Then
    .Range(.Cells(2, 1), .Cells(j, lCol)).Insert Shift:=xlShiftDown
  End If
End With
Application.ScreenUpdating = True
End Sub
Cross-posted at: http://www.excelforum.com/excel-prog...lue-cells.html
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 07-01-2015 at 05:53 AM. Reason: Minor Code Revision
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate date if date entered in cell, do nothing if blank ConfuddledOne Excel 3 11-07-2014 09:37 AM
Help with Subtotal(103, ) formula and blank cells zhl203 Excel 1 07-30-2014 03:40 PM
Join cells together separated by ; when some are blank leemoreau Excel 3 11-03-2013 11:22 AM
how to list missing all date by blank row between change value cells? Selecting blank cells in criteria apolloman Excel 6 08-24-2011 05:38 AM
how to list missing all date by blank row between change value cells? Imported message date change to today's date promark Outlook 1 12-23-2005 07:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:03 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft