Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-30-2015, 11:02 PM
poem poem is offline how to list missing all date by blank row between change value cells? Windows XP how to list missing all date by blank row between change value cells? Office 2007
Novice
how to list missing all date by blank row between change value cells?
 
Join Date: Jun 2015
Location: oman
Posts: 13
poem is on a distinguished road
Default how to list missing all date by blank row between change value cells?


i am looking for macro code that isert blank row between data( missing all date) when change value data which each cells are started frist month if not mentied till end of month too
Attached Images
File Type: jpg SCREEN SHOT .jpg (272.3 KB, 34 views)
Attached Files
File Type: xlsx sheet .xlsx (136.9 KB, 12 views)
Reply With Quote
  #2  
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: 21,963
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
  #3  
Old 07-01-2015, 06:33 AM
poem poem is offline how to list missing all date by blank row between change value cells? Windows XP how to list missing all date by blank row between change value cells? Office 2007
Novice
how to list missing all date by blank row between change value cells?
 
Join Date: Jun 2015
Location: oman
Posts: 13
poem is on a distinguished road
Default

thank you too much i appericate .
Reply With Quote
  #4  
Old 07-01-2015, 06:36 AM
p45cal's Avatar
p45cal p45cal is offline how to list missing all date by blank row between change value cells? Windows 7 32bit how to list missing all date by blank row between change value cells? Office 2010 32bit
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

cross post http://www.excelguru.ca/forums/showt...ge-value-cells
Reply With Quote
  #5  
Old 07-02-2015, 12:21 AM
poem poem is offline how to list missing all date by blank row between change value cells? Windows XP how to list missing all date by blank row between change value cells? Office 2007
Novice
how to list missing all date by blank row between change value cells?
 
Join Date: Jun 2015
Location: oman
Posts: 13
poem is on a distinguished road
Default add feature in code

could you arrange me feature like
start date for each cell = date serial( 2015,06,01)
end date for each cell =date serial (2015,06,30)
note if frist date not mentiond ( 2015,06,01) insert blank row
and insert blank row till end date (2015,06,30)
add in this 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
Attached Files
File Type: xlsx sheet 2 .xlsx (144.8 KB, 8 views)
Reply With Quote
  #6  
Old 07-02-2015, 02:18 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: 21,963
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

poem: Please continue your discussion in your existing thread instead of starting a new one. As it stands, your post here has no context. It would also have been helpful if you'd said you wanted this extra output when you made your initial request - no-one wants to spend time revising their code just because the specifications they were given were incomplete. In some cases, providing incomplete specifications could lead to the code having to be completely re-written.

Also, when posting code, please use the code tags, inserted via the # button on the posting toolbar.

Update: Threads merged.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 07-02-2015 at 02:20 AM. Reason: Threads merged
Reply With Quote
  #7  
Old 07-02-2015, 02:35 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: 21,963
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, k As Long, l 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
        l = .Range("B" & i + 1).Value
        .Range(.Cells(i + 1, 1), .Cells(i + j, lCol)).Insert Shift:=xlShiftDown
        For k = i + j To i + 1 Step -1
          l = l - 1
          .Range("B" & k).Value = Format(l, "dd-mmm-yyyy")
        Next
      End If
    End If
  Next
  j = Format(.Range("B2").Value, "dd")
  If j > 1 Then
    l = .Range("B" & i + 1).Value
    .Range(.Cells(2, 1), .Cells(j, lCol)).Insert Shift:=xlShiftDown
    For k = j To 2 Step -1
      l = l - 1
      .Range("B" & k).Value = Format(l, "dd-mmm-yyyy")
    Next
  End If
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 07-02-2015, 02:51 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: 21,963
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

poem: I see you have cross-posted again, at:
http://www.excelguru.ca/forums/showt...eature-in-code
and:
http://www.excelforum.com/excel-prog...e-in-code.html
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184

If you make a habit of cross-posting without providing links, you'll soon find yourself being ignored and, possibly, eventually being banned on various forums... Be assured, I've seen it happen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 07-03-2015, 06:26 AM
poem poem is offline how to list missing all date by blank row between change value cells? Windows XP how to list missing all date by blank row between change value cells? Office 2007
Novice
how to list missing all date by blank row between change value cells?
 
Join Date: Jun 2015
Location: oman
Posts: 13
poem is on a distinguished road
Default

Absolutely I never have done it again thanks .
And listened to your advice able
Reply With Quote
  #10  
Old 07-03-2015, 06:36 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: 21,963
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

Please advise the other forums that the problem has been solved, so as to not waste anyone else's time...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 07-03-2015, 11:17 AM
poem poem is offline how to list missing all date by blank row between change value cells? Windows XP how to list missing all date by blank row between change value cells? Office 2007
Novice
how to list missing all date by blank row between change value cells?
 
Join Date: Jun 2015
Location: oman
Posts: 13
poem is on a distinguished road
Default

okey my dear
Reply With Quote
Reply



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 06:22 AM.


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