PC Review


Reply
Thread Tools Rate Thread

Copy rows from Sheet1 to Sheet2 when Column B values equal "X" andColumn C values > 100

 
 
u473
Guest
Posts: n/a
 
      21st Jun 2010
How do I copy rows (Columns A,B,D only, values only) from Sheet1 to
Sheet2, same workbook.
when Column B values equal "X" and Column C values > 100.
Help appreciated
J.P.
 
Reply With Quote
 
 
 
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      22nd Jun 2010
On Jun 21, 5:38*pm, u473 <u...@aol.com> wrote:
> How do I copy rows (Columns A,B,D only, values only) from Sheet1 to
> Sheet2, same workbook.
> *when Column B values equal "X" and Column C values > 100.
> Help appreciated
> J.P.


Sub SAS_CopyValuesIF()
Dim r As Double
Dim i As Long
r = 16 'start row on destination sheet
For i = 1 To Cells(Rows.Count, "b").End(xlUp).Row
If UCase(Cells(i, 2)) = "X" And Cells(i, 3) > 100 Then
Sheets("sheet4").Cells(r, 1).Value = Cells(i, 1).Value
Sheets("sheet4").Cells(r, 2).Value = Cells(i, 2).Value
Sheets("sheet4").Cells(r, 3).Value = Cells(i, 4).Value
r = r + 1
End If
Next i
End Sub
 
Reply With Quote
 
u473
Guest
Posts: n/a
 
      24th Jun 2010
Thank you,
Well appreciated,
J.P.
 
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
Compare Sheet1 value to values in Sheet2 Column A Corey Microsoft Excel Programming 0 4th Nov 2007 08:19 PM
Copy Rows Multiple times "changing" values in one column EE Microsoft Excel Programming 4 12th Oct 2007 11:32 AM
how do copy "sheet1!A1+1 in sheet2 to sheet 3 and get "sheet2!A1+ =?Utf-8?B?RGFueQ==?= Microsoft Excel Misc 5 16th Apr 2007 03:27 AM
Copy values from Sheet1 to Sheet2 Eintsein_mc2 Microsoft Excel Misc 1 6th Jan 2005 05:02 AM
Copy values only, sheet1 to sheet2 without Selection =?Utf-8?B?Um9iZXJ0IENocmlzdGll?= Microsoft Excel Programming 4 20th Oct 2004 02:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:47 PM.