Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Lewis Evans   on Dec 15 In MS Office Category.

  
Question Answered By: Aaeedah Khan   on Dec 15

Sorry, it sounds like you took the code I posted and added  in the
parts from your original code. You are using a separate subroutine  to
select the row and do the inserting. That is probably why it
is "restarting." You don't need to select the row to act on it, you
can use the cell  properties to manipulate the data. I tested the code
below and it worked.



Sub FindDate()
'
'
'
Dim iLoop As Integer
Dim rNa As Range
Dim i As Integer

iLoop = WorksheetFunction.CountIf(Columns(1), "26/7/2007")
Set rNa = Range("A1")

For i = 1 To iLoop
Set rNa = Columns(1).Find(What:="26/7/2007", After:=rNa, _
LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True)
rNa.EntireRow.Insert
Next i

End Sub

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Find a date over & over Or get search suggestion and latest updates.


Tagged: