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: 27,285
Default FindNext and Copy Help (Urgent)

Dim Rng As Range, Rng1 as Range
Application.Worksheets("Sheet3").Select
Set Rng = Range("data").Find(What:="31", LookAt:=xlWhole, LookIn:=xlValues)
If Rng Is Nothing Then
MsgBox "Data Not Found"
Exit Sub
Else
set rng1 = rng
do while rng1.offset(1,0).Value = 31
set rng1 = rng1.offset(1,0)
Loop
Range(Rng,rng1).Offset(0, 1).Copy _
Destination:=Application.Worksheets("Sheet1").Rang e("A2")
End If

--
Regards,
Tom Ogilvy


"Lolly" wrote in message
...
My SourceData looks as follows

Measure Value


31 132
31 135
34 123
34 124
35 235

My code looks like this

Dim Rng As Range
Application.Worksheets("Sheet3").Select
Set Rng = Range("data").Find(What:="31", LookAt:=xlWhole,

LookIn:=xlValues)
If Rng Is Nothing Then
MsgBox "Data Not Found"
Exit Sub
Else
Rng.Offset(0, 1).Copy
Destination:=Application.Worksheets("Sheet1").Rang e("A2")
End If


This copies only first value of 31 in the sheet1. I want to copy all the
values corresponding to 31
In sheet1

Data should look like this

132 135 ...Till the last Occurence of value 31 is there it needs to be
copied to sheet1

If anyone could help me urgently

Thanx








--
Kittie



 
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
Findnext Noemi Excel Discussion (Misc queries) 1 December 12th 05 11:23 AM
FindNext and Copy Help (Urgent) Don Guillett[_4_] Excel Programming 1 August 23rd 04 07:04 PM
FindNext SJ[_6_] Excel Programming 7 May 21st 04 06:01 AM
FindNext problem mark kubicki Excel Programming 4 February 14th 04 02:42 AM
problem with .FindNext Bob Cochran Excel Programming 6 October 11th 03 02:02 PM


All times are GMT +1. The time now is 03:14 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"