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: 68
Default loop issue

Hi All,

Can anyone tell me why the code will not go thru the loop the second time
again?
so I enter "Bat, Cat" in the textbox and all the complaints for Bat get copy
over correctly. But the code stop at If LCase(Worksheets("Complaint
Log").Cells(datecompRng.Row, DescripRng.Column).Value) Like "*" &
LCase(wordkey) & "*" Then when it comes to Cat (meaning the msgbox
"contain word" doesn't display when it should). So, is there a reason why it
is not doing the comparsion the second time around?

thanks for the help!

See code below:

Do Until IsNumeric(Application.Search(",", MyValue)) = False
If IsNumeric(Application.Search(",", MyValue)) Then
Num_Values = Num_Values + 1
MyValue = Right(MyValue, Len(MyValue) -
Application.Search(",", MyValue))
End If
Loop

MyValue = keyphrase
ReDim NewValue(Num_Values)

For i = 0 To UBound(NewValue)
If IsNumeric(Application.Search(",", MyValue)) Then
NewValue(i) = Left(MyValue, Application.Search(",", MyValue)
- 1)
MyValue = Right(MyValue, Len(MyValue) -
Application.Search(",", MyValue))
Else
NewValue(i) = MyValue
End If
wordkey = NewValue(i)

With Worksheets("complaint Log")
Set datecompRng = .Range("I2", .Cells(.Rows.Count,
"I").End(xlUp))
Set DescripRng = .Range("E2", .Cells(.Rows.Count,
"E").End(xlUp))
End With

For Each datecompRng In datecompRng.Cells
If datecompRng = date1 And datecompRng <= date2 Then
MsgBox "something here"
If LCase(Worksheets("Complaint
Log").Cells(datecompRng.Row, DescripRng.Column).Value) Like "*" &
LCase(wordkey) & "*" Then
MsgBox "contain word"
datecompRng.EntireRow.Copy
Sheets("Result_Sheet").Select
Cells(Rows.Count, 1).End(xlUp)(2).Select
Selection.PasteSpecial Paste:=xlAll
End If

End If
Next datecompRng
Call product_math(wordkey)
Next i
--
Learning
 
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
odd issue with a loop Joseph Atie Excel Programming 4 February 12th 09 11:44 PM
odd issue with a loop Joseph Atie Excel Programming 0 February 12th 09 04:33 AM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 5 March 29th 07 05:48 AM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 0 March 27th 07 11:17 PM
Issue with Do Loop Linking to specific cells in pivot table Excel Programming 3 July 24th 05 10:38 PM


All times are GMT +1. The time now is 04:49 AM.

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"