Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copying and transfering select rows of data

Hi
After 2 hours of trying and sifting through the discussion group I am beaten
enough to ask for help...

I have approx 1000 patient's data in a large spreadsheet recorded
horizontally next to 'ID numbers' in column A.

I have a separate list of 240 or so 'ID numbers', and I'd like them and all
their data to be transfered from the main spreadsheet. I understand the macro
has to run something like (for each of the 240 IDs)

Find 'Patient ID' (in main spreedsheet)
Select Row
Copy row
Activate Sheet 2 (blank spreadsheet)
Paste Row

I can program the last 3 steps but the first two I can't get to work
properly...

Any advice would be VERY much appreciated...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Copying and transfering select rows of data

Parmenion,

How about this: in cell B2 (assuming your desired ID's start in cell A2) use
the formula:

=VLOOKUP($A2,'Sheet Name'!$A$1:$Z$1000,COLUMN(),FALSE)

Change the Z1000 to reflect the lower left cell of your data table, and
change Sheet Name to reflect the actual sheet name with the data table.

Copy down column 2 to match your IDs in column A, then copy across for as
many columns of data as you need.

HTH,
Bernie
MS Excel MVP




"Parmenion" wrote in message
...
Hi
After 2 hours of trying and sifting through the discussion group I am
beaten
enough to ask for help...

I have approx 1000 patient's data in a large spreadsheet recorded
horizontally next to 'ID numbers' in column A.

I have a separate list of 240 or so 'ID numbers', and I'd like them and
all
their data to be transfered from the main spreadsheet. I understand the
macro
has to run something like (for each of the 240 IDs)

Find 'Patient ID' (in main spreedsheet)
Select Row
Copy row
Activate Sheet 2 (blank spreadsheet)
Paste Row

I can program the last 3 steps but the first two I can't get to work
properly...

Any advice would be VERY much appreciated...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copying and transfering select rows of data

Thank you! Worked perfectly.

"Bernie Deitrick" wrote:

Parmenion,

How about this: in cell B2 (assuming your desired ID's start in cell A2) use
the formula:

=VLOOKUP($A2,'Sheet Name'!$A$1:$Z$1000,COLUMN(),FALSE)

Change the Z1000 to reflect the lower left cell of your data table, and
change Sheet Name to reflect the actual sheet name with the data table.

Copy down column 2 to match your IDs in column A, then copy across for as
many columns of data as you need.

HTH,
Bernie
MS Excel MVP




"Parmenion" wrote in message
...
Hi
After 2 hours of trying and sifting through the discussion group I am
beaten
enough to ask for help...

I have approx 1000 patient's data in a large spreadsheet recorded
horizontally next to 'ID numbers' in column A.

I have a separate list of 240 or so 'ID numbers', and I'd like them and
all
their data to be transfered from the main spreadsheet. I understand the
macro
has to run something like (for each of the 240 IDs)

Find 'Patient ID' (in main spreedsheet)
Select Row
Copy row
Activate Sheet 2 (blank spreadsheet)
Paste Row

I can program the last 3 steps but the first two I can't get to work
properly...

Any advice would be VERY much appreciated...




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
Copying data from one workbook to another dependent on user select sarahphonics Excel Discussion (Misc queries) 1 April 19th 10 04:37 PM
can you select paste area before copying data Roz2459 Excel Discussion (Misc queries) 4 January 29th 09 02:22 PM
How can i randomly select 780 rows from 4000 rows of data bbb Excel Worksheet Functions 2 July 6th 07 08:21 PM
Select certain data rows lee's news New Users to Excel 2 December 19th 06 09:19 PM
select block of rows w/data between blank rows Janna Excel Programming 6 February 13th 05 02:45 AM


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