Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default Copy from sheet to sheet when matches criteria

I need to copy values from Col B Sheet2, to Col D Sheet1 only if Col A on
Sheet1 matches Col A on Sheet2 and Col B on Sheet 1 has the text "Year to
Date". The last row and number of rows in between each Year to Date row will
vary each week.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 257
Default Copy from sheet to sheet when matches criteria

How you do this depends on what you mean by "copy", jeremiah. If you mean it
literally, you can't do it with worksheet functions; you'll have to do it
with VBA, and although it isn't hard, you'll have to switch this question to
the other forum, "Excel Programming".

On the other hand, if you're content just to display it in the new location,
you can use an IF function. If, for example, when you say "Col B" etc you
really mean "this cell in col B", you can put this function in each cell of
col D: IF(AND(A2=Sheet2!A2,B2="Year to Date"),Sheet2!B2,"").

But maybe you really mean the WHOLE column - that is, you want each cell in
Sheet1!D to display the same cell in Sheet2!B only if ALL of A:A equals
Sheet2!A:A and ALL of B:B equals "Year to Date". I can think of ways to do
that, but I'll bet they're unnecessarily complex; maybe someone else can
think of a simple way to do that.

--- "jeremiah" wrote:
I need to copy values from Col B Sheet2, to Col D Sheet1 only if Col A on
Sheet1 matches Col A on Sheet2 and Col B on Sheet 1 has the text "Year to
Date". The last row and number of rows in between each Year to Date row will
vary each week.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default Copy from sheet to sheet when matches criteria

I actually am looking for a VBA solution. My cell locations are going to
vary every week, I can use offset for the columns but the rows are constantly
going to change. I tried to ask this request of several forums yesterday but
kept getting an error. Don't know if it was because of my internet or
something else. I did finally get it to post via the worksheet functions.
Thanks, I will ask the same question at the other forum.

"Bob Bridges" wrote:

How you do this depends on what you mean by "copy", jeremiah. If you mean it
literally, you can't do it with worksheet functions; you'll have to do it
with VBA, and although it isn't hard, you'll have to switch this question to
the other forum, "Excel Programming".

On the other hand, if you're content just to display it in the new location,
you can use an IF function. If, for example, when you say "Col B" etc you
really mean "this cell in col B", you can put this function in each cell of
col D: IF(AND(A2=Sheet2!A2,B2="Year to Date"),Sheet2!B2,"").

But maybe you really mean the WHOLE column - that is, you want each cell in
Sheet1!D to display the same cell in Sheet2!B only if ALL of A:A equals
Sheet2!A:A and ALL of B:B equals "Year to Date". I can think of ways to do
that, but I'll bet they're unnecessarily complex; maybe someone else can
think of a simple way to do that.

--- "jeremiah" wrote:
I need to copy values from Col B Sheet2, to Col D Sheet1 only if Col A on
Sheet1 matches Col A on Sheet2 and Col B on Sheet 1 has the text "Year to
Date". The last row and number of rows in between each Year to Date row will
vary each week.

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
Auto Copy/autofill Text from sheet to sheet if meets criteria Joyce Excel Discussion (Misc queries) 0 November 20th 08 11:05 PM
copy row to new sheet where cell value meets criteria djhs63 Excel Discussion (Misc queries) 1 February 13th 07 03:04 PM
How to copy rows that meet criteria to another sheet in Excel Bruce Excel Worksheet Functions 9 November 2nd 06 11:12 PM
Copy entire row to another sheet based on a criteria Brig Siton Excel Discussion (Misc queries) 3 August 7th 06 09:04 PM
If Info. from one Sheet matches, send it to another sheet Slava Excel Discussion (Misc queries) 1 June 21st 05 06:36 PM


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