Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Stop fill in the blanks (down) at specific row

Works fine. Just need to add command to stop at specific row.
Starts at 25, lets say stop specifically at row 1000.


Sub FillInTheBlanks_1()
Dim Area As Range, LastRow As Long
On Error Resume Next
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
For Each Area In Intersect(Rows("25:" & LastRow), Range("C25"). _
Resize(LastRow).SpecialCells(xlCellTypeBlanks)).Ar eas
Area.Value = Area(1).Offset(-1).Value
Next
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Stop fill in the blanks (down) at specific row

This should work:


Sub FillInTheBlanks_1()
Dim Area As Range, LastRow As Long
On Error Resume Next
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
For Each Area In Intersect(Rows("25:" & LastRow), Range("C25"). _
Resize(LastRow).SpecialCells(xlCellTypeBlanks)).Ar eas
If Area.Row < 1000 Then
Area.Value = Area(1).Offset(-1).Value
End If
Next
End Sub






"J.W. Aldridge" wrote in message
...
Works fine. Just need to add command to stop at specific row.
Starts at 25, lets say stop specifically at row 1000.


Sub FillInTheBlanks_1()
Dim Area As Range, LastRow As Long
On Error Resume Next
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
For Each Area In Intersect(Rows("25:" & LastRow), Range("C25"). _
Resize(LastRow).SpecialCells(xlCellTypeBlanks)).Ar eas
Area.Value = Area(1).Offset(-1).Value
Next
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Stop fill in the blanks (down) at specific row

Give this a try...

Sub FillInTheBlanks_1()
Dim Area As Range, LastRow As Long
Const StopRow As Long = 1000
On Error Resume Next
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
For Each Area In Range("C25").Resize(LastRow). _
SpecialCells(xlCellTypeBlanks).Areas
If Area.Row + Area.Rows.Count StopRow Then
Range(Area(1), Cells(StopRow, "C")).Value = Area(1).Offset(-1).Value
Exit For
Else
Area.Value = Area(1).Offset(-1).Value
End If
Next
End Sub

--
Rick (MVP - Excel)



"J.W. Aldridge" wrote in message
...
Works fine. Just need to add command to stop at specific row.
Starts at 25, lets say stop specifically at row 1000.


Sub FillInTheBlanks_1()
Dim Area As Range, LastRow As Long
On Error Resume Next
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
For Each Area In Intersect(Rows("25:" & LastRow), Range("C25"). _
Resize(LastRow).SpecialCells(xlCellTypeBlanks)).Ar eas
Area.Value = Area(1).Offset(-1).Value
Next
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Stop fill in the blanks (down) at specific row

That won't stop at **exactly** Row 1000 if Row 1000 (in Column C) is in the
middle of a group of blank cells.

--
Rick (MVP - Excel)



"JLGWhiz" wrote in message
...
This should work:


Sub FillInTheBlanks_1()
Dim Area As Range, LastRow As Long
On Error Resume Next
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
For Each Area In Intersect(Rows("25:" & LastRow), Range("C25"). _
Resize(LastRow).SpecialCells(xlCellTypeBlanks)).Ar eas
If Area.Row < 1000 Then
Area.Value = Area(1).Offset(-1).Value
End If
Next
End Sub






"J.W. Aldridge" wrote in message
...
Works fine. Just need to add command to stop at specific row.
Starts at 25, lets say stop specifically at row 1000.


Sub FillInTheBlanks_1()
Dim Area As Range, LastRow As Long
On Error Resume Next
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
For Each Area In Intersect(Rows("25:" & LastRow), Range("C25"). _
Resize(LastRow).SpecialCells(xlCellTypeBlanks)).Ar eas
Area.Value = Area(1).Offset(-1).Value
Next
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill in the blanks! Bhupinder Rayat Excel Programming 2 March 2nd 06 04:47 PM
Fill in the blanks! Bhupinder Rayat Excel Programming 2 March 2nd 06 04:46 PM
Fill in the blanks!! Bhupinder Rayat Excel Programming 1 March 2nd 06 04:33 PM
Fill in the blanks BOB Excel Programming 1 January 31st 05 06:21 PM
Fill in the blanks Jim Thomlinson[_3_] Excel Programming 0 January 31st 05 06:16 PM


All times are GMT +1. The time now is 11:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"