PC Review


Reply
Thread Tools Rate Thread

Copy Cell, Paste based on a match.

 
 
=?Utf-8?B?UGV0ZQ==?=
Guest
Posts: n/a
 
      23rd Jul 2007
I am hoping someone can help,

I want to be able to copy a specific cell ("C3") in sheet1 and paste it to
another cell (Z?) in sheet2 based on a match of cell ("A3") in sheet1 to a
same matching record in sheet 2 out of column A, but the row number might be
2, 43, 76......

Thanks in advance for any help.
--
Pete
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      23rd Jul 2007
Sub copyandpaste()

Sheets("Sheet2").Activate

LastRowSh2 = Cells(Rows.Count, "A").End(xlUp).Row
Set FindRange = Range(Cells(1, "A"), Cells(LastRowSh2, "A"))

OldValue = Sheets("Sheet1").Range("A3")
NewValue = Sheets("Sheet1").Range("C3")

FindRange.Replace What:=OldValue, Replacement:=NewValue

End Sub

"Pete" wrote:

> I am hoping someone can help,
>
> I want to be able to copy a specific cell ("C3") in sheet1 and paste it to
> another cell (Z?) in sheet2 based on a match of cell ("A3") in sheet1 to a
> same matching record in sheet 2 out of column A, but the row number might be
> 2, 43, 76......
>
> Thanks in advance for any help.
> --
> Pete

 
Reply With Quote
 
=?Utf-8?B?UGV0ZQ==?=
Guest
Posts: n/a
 
      23rd Jul 2007
Thanks Joel, this seamed to do the trick.
--
Pete


"Joel" wrote:

> Sub copyandpaste()
>
> Sheets("Sheet2").Activate
>
> LastRowSh2 = Cells(Rows.Count, "A").End(xlUp).Row
> Set FindRange = Range(Cells(1, "A"), Cells(LastRowSh2, "A"))
>
> OldValue = Sheets("Sheet1").Range("A3")
> NewValue = Sheets("Sheet1").Range("C3")
>
> FindRange.Replace What:=OldValue, Replacement:=NewValue
>
> End Sub
>
> "Pete" wrote:
>
> > I am hoping someone can help,
> >
> > I want to be able to copy a specific cell ("C3") in sheet1 and paste it to
> > another cell (Z?) in sheet2 based on a match of cell ("A3") in sheet1 to a
> > same matching record in sheet 2 out of column A, but the row number might be
> > 2, 43, 76......
> >
> > Thanks in advance for any help.
> > --
> > Pete

 
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 and paste rows from one wksht to another based on cell value PVANS Microsoft Excel Programming 3 22nd Mar 2010 12:09 PM
Need code to copy and paste based on cell address. GoBow777 Microsoft Excel Misc 1 13th Jul 2008 07:24 AM
Copy&Paste variable range based on cell value =?Utf-8?B?VGhvbWFz?= Microsoft Excel Programming 0 27th Jul 2007 06:40 PM
Copy and paste row based on cell content =?Utf-8?B?QkRhbg==?= Microsoft Excel Programming 1 30th Jun 2006 04:15 PM
Copy/Paste based on cell content. Hugh Askew Microsoft Excel Programming 2 25th Apr 2004 01:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:17 AM.