LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default Fill blanks with find results


Hi,

I'm trying to modify this code to look for all blank cells starting with
row3 and fill them in with find results from the data worksheet. This code
works for the first blank cell but stops there. I would like to start with
selecting the first blank cell, looking at the value (text) of the cell blow
it, searching for this value in a long string of text on the data sheet, and
then copying the entire row from the data sheet to the blank cell row. I'm
basically trying to title each group of rows. I would then like to procede
to the next blank cell to do the same until I reach the end of blank cells
with the used range. This is the code I'm starting with.

Sub FindGroupID()
Dim intS As Integer
Dim rngC As Range
Dim strToFind As String, FirstAddress As String
Dim wSht As Worksheet

Application.ScreenUpdating = False

intS = 3
'This step assumes that you have a worksheet named
'Data.
Set wSht = Worksheets("Sheet1")
strToFind = ActiveCell.Offset(1, 0).Value
'Change this range to suit your own needs.
With Worksheets("Data").Range("A1:A100")
Set rngC = .Find(what:=strToFind, LookAt:=xlPart)
If Not rngC Is Nothing Then
FirstAddress = rngC.Address
Do
rngC.EntireRow.Copy wSht.Cells(intS, 1)
intS = intS + 1
Set rngC = .FindNext(rngC)
Loop While Not rngC Is Nothing And rngC.Address < FirstAddress
End If
End With

End Sub

Any help that anyone can provide would be greatly appreciated.
--
By persisting in your path, though you forfeit the little, you gain the
great.

 
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
How to fill up blanks deeds Excel Discussion (Misc queries) 4 October 13th 09 05:52 PM
Clear if "#N/A" and Find End of Range, Fill Blanks ryguy7272 Excel Programming 4 July 23rd 08 01:36 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 10:56 AM.

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

About Us

"It's about Microsoft Excel"