PC Review


Reply
Thread Tools Rate Thread

Copy to designated sheet based on value in cell

 
 
JDaywalt
Guest
Posts: n/a
 
      21st Mar 2008
I have two workbooks, let's call them Parent & Child. Parent is the master
template that contains a cross-ref table on sheet tab labeled "Xref" that
shows a long description in column A, and the corresponding sheet tab name in
column B. It also then contains each of the designated sheet tabs. Here is
an example of what the "Xref" tab looks like:
A B
1 This is long description #1 LongDesc1
2 This is long description #2 LongDesc2
3 This is long description #3 LongDesc3

Each of the 'Child' files contains a description on Sheet 1, cell A1 that
corresponds with the long descriptions in the Xref table of the Parent file.
I need to write code (executed from the Parent file), that will go to the
Child file, find the long description from Sheet 1, cell A1, then copy 'all
cells' from Sheet 1 onto the proper sheet tab in the Parent file based upon
the cross-reference table above. Can someone help me with this?

 
Reply With Quote
 
 
 
 
Jarek Kujawa
Guest
Posts: n/a
 
      23rd Mar 2008
try to select cells in Column A and then:

For Each Cell in Selection
Workbooks("Child").Activate
If Sheet1.Range("A1") = Cell Then
Sheet1.UsedRange.Copy
Workbooks("Parent").Activate
Sheets(Cell.Offset(0,1)).Activate
Cells(1,1).Select
Selection.Paste
End if
Next Cell

HIH

On 21 Mar, 16:24, JDaywalt <JDayw...@discussions.microsoft.com> wrote:
> I have two workbooks, let's call them Parent & Child. *Parent is the master
> template that contains a cross-ref table on sheet tab labeled "Xref" that
> shows a long description in column A, and the corresponding sheet tab namein
> column B. *It also then contains each of the designated sheet tabs. *Here is
> an example of what the "Xref" tab looks like:
> * * * * * * * * * *A * * * * * * * * * * * * * * * * * * B
> 1 *This is long description #1 * * * *LongDesc1
> 2 *This is long description #2 * * * *LongDesc2
> 3 *This is long description #3 * * * *LongDesc3
>
> Each of the 'Child' files contains a description on Sheet 1, cell A1 that
> corresponds with the long descriptions in the Xref table of the Parent file. *
> I need to write code (executed from the Parent file), that will go to the
> Child file, find the long description from Sheet 1, cell A1, then copy 'all
> cells' from Sheet 1 onto the proper sheet tab in the Parent file based upon
> the cross-reference table above. *Can someone help me with this?


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy rows from one Data sheet to another sheet based on cell conte John McKeon Microsoft Excel Misc 2 15th May 2010 06:49 AM
Copy Row to Another Sheet Based on Cell Value gth0824@gmail.com Microsoft Excel Programming 1 10th Jul 2008 04:49 PM
Help: auto-copy entire rows from 1 sheet (based on cell criteria) to another sheet. bertbarndoor Microsoft Excel Programming 4 5th Oct 2007 04:00 PM
VAB to copy cell values into new Sheet, Overwrite if needed and based off of Cell Value in a column gumby Microsoft Excel Programming 4 14th Jul 2007 01:55 AM
Re: Copy rows from one sheet to another based on a cell value =?Utf-8?B?TWF4?= Microsoft Excel New Users 0 21st Dec 2006 01:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 AM.