Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help with a Loop please

Kamal,
Can you please repost Function FindValueExists as my newsreader appears only
to have the first line
Thanks
Martin
Kamal wrote in message ...
You can add few changes to the for loop and pass the excel sheet to the
method FindValueExists(sheet, val, indexOnDestSheet) might help you.

"Martin" wrote in message
...
Kamal,

Thanks for responding so quickly, but I obviously didn't explain

accurately
enough. The results contained in e2:e48 need to be matched to values in

the
first workbook. The results contained in e50:e97, may be the same results
numerically as e2:e48, but these need to be matched to a different set of
values in the second workbook.

Am I missing something or should there be more to the function?

Thanks
Martin

Kamal wrote in message ...
Hi,

I am not sure whether the solution exactly works for you. You can

define
a
named range on the 384 results by

Range(Cells(10,1),Cells(384,1)).name = "MyRange"


rngCount = Range("MyRange").Rows.count
J = 1
' Loop through the entire range. and the Named Range will take care of

the
address of the cell.

For I = 1 to rngCount
val = Range("MyRange).Cells(I,col). value

If FindValueExists(val) then ' check whether it exists in another

sheet

Range("MyRange").Rows(I).copy

Destination:=Worksheets(index).Cells(J,6)
J = J + 1

End If

Next

Function FindValueExists(val as Integer) as boolean ' This method will

match
the given integer value against the 8 values in other workbook

regards
Kamal








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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
need help with loop ? again chrisnsmith Excel Discussion (Misc queries) 4 March 1st 09 03:00 PM
do..loop Anna Excel Discussion (Misc queries) 6 June 20th 07 01:10 PM
Do Loop Noemi Excel Discussion (Misc queries) 0 December 8th 05 10:43 PM
Help with Do...Loop Noemi Excel Discussion (Misc queries) 1 December 7th 05 12:59 AM


All times are GMT +1. The time now is 05:36 PM.

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"