Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Selection Data from a Range

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
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





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
Narrow Range based on Selection in Another Range David Excel Discussion (Misc queries) 3 July 1st 07 05:12 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
re-selection of Chart data range using keyboard David Excel Worksheet Functions 0 June 15th 05 10:08 AM
Selection in data range Dr.Schwartz Excel Programming 5 February 1st 05 08:05 AM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


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