PC Review


Reply
Thread Tools Rate Thread

Copy & Paste...if

 
 
Saintsman
Guest
Posts: n/a
 
      7th Feb 2008
I want to copy values from ColB (Range2) but paste only if values in ColA
(Range1) = a specified value eg yes. I work with named ranges
ColA ColB result (different sheet)
yes 10 10
yes 12 12
no 5 30
no 10
yes 30
no 12
Any help as always gratefully received
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      7th Feb 2008

Sub test()

RowCount = 1
NewRowCount = 1
With ActiveSheet
Do While .Range("A" & RowCount) <> ""
If .Range("A" & RowCount) = "Yes" Then
.Range("B" & RowCount).Copy _
Destination:=Sheets("NewSheet").Range("A" & NewRowCount)
NewRowCount = NewRowCount + 1
End If

RowCount = RowCount + 1
Loop
End With

End Sub

"Saintsman" wrote:

> I want to copy values from ColB (Range2) but paste only if values in ColA
> (Range1) = a specified value eg yes. I work with named ranges
> ColA ColB result (different sheet)
> yes 10 10
> yes 12 12
> no 5 30
> no 10
> yes 30
> no 12
> Any help as always gratefully received

 
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
How do I get copy/paste to copy/paste text and not the whole page =?Utf-8?B?Q2Fyb2wgSi4=?= Microsoft Word Document Management 1 6th May 2005 09:03 PM
Copy and Paste macro needs to paste to a changing cell reference =?Utf-8?B?bG91bG91?= Microsoft Excel Programming 0 24th Feb 2005 10:29 AM
Copy & Paste Object without using the Excel Copy Paste functions =?Utf-8?B?R2Fueg==?= Microsoft Excel New Users 0 10th Mar 2004 07:06 AM
Copy & Paste Object without using the Excel Copy Paste functions =?Utf-8?B?R2Fueg==?= Microsoft Excel Misc 0 10th Mar 2004 07:06 AM
Re: Copy/Paste in Excel prints highlighted cells and does not paste Dave Peterson Microsoft Excel Misc 0 30th Jul 2003 11:08 PM


Features
 

Advertising
 

Newsgroups
 


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