View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Selection Data from a Range

possibly try this modification:

if sheets1.cells(r,1).Text = "007" then
sheets2.Cells(r,1).Resize(1,10).Value = _
sheets1.Cells(r,1).Resize(1,10).Value
end if

Note that the Sheets2 and Sheets1 is usually Sheet2 and Sheet1 unless you
changed them in the VBE.

--
Regards,
Tom Ogilvy


"Mr M Walker" wrote in message
...
I am trying to select data from a range of data using an If STATEMENTS, is
this possible please see below:

I am trying to return 10 columns of data if a uique number is found in a
spreasheet for example

005
006
007
008

if sheets1.cells(r,1) = "007" then
sheets2.cells(r,1) = sheets1.cells(r,1)
sheets2.cells(r,2) = sheets1.cells(r,2)
sheets2.cells(r,3) = sheets1.cells(r,3)
End if