LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Copy all Rows If Column Value X within a Range

Hi,
Would like to do the following within a range ex
A9:Z18: If column U has an X , copy all rows which
contain X and paste to sheet 2, else if Column V has X, copy all rows and
paste
on sheet 3 range A7 Else if Column W has X copy/paste to sheet 4 range A9.
I tried something like below:
Dim i As Long
Range("A9:Z18").Select
For i = 1 To ActiveSheet.UsedRange.Rows.Count
If Cells(i, "U") Like "*X*" Then
Cells(i, "U").EntireRow.Select
Selection.Copy
Sheets("Sheet2").Select
Range("A9").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ElseIf Cells(i, "V") Like "*X*" Then
Cells(i, "V").EntireRow.Select
Selection.Copy
Sheets("Sheet3").Select
Range("A7").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
etc.

But seems to only copy one row from Column U. Would appreciate any help.
Thank you,
JUAN
 
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
A macro to copy & paste many rows (a range) to the next column .. genehunter New Users to Excel 11 April 21st 09 07:36 AM
copy a range with known start column to variable end column Matilda Excel Programming 2 August 2nd 06 04:55 PM
Copy rows with a specific value in column A Gert-Jan Excel Programming 7 June 23rd 06 05:13 PM
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
Copy Column headings to Rows DTTODGG New Users to Excel 2 November 14th 05 04:09 PM


All times are GMT +1. The time now is 09:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"