Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I need to copy rows where value of Col L matches with cell A1 and paste in a different sheet. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Right click the sheet tab with your source data and view code and paste the code below in. It copies to sheet2 so change to suit Sub delete_Me() Dim copyrange As Range lastrow = Cells(Cells.Rows.Count, "L").End(xlUp).Row Set MyRange = Range("L2:L" & lastrow) For Each c In MyRange If c = Range("A1").Value Then If copyrange Is Nothing Then Set copyrange = c.EntireRow Else Set copyrange = Union(copyrange, c.EntireRow) End If End If Next If Not copyrange Is Nothing Then copyrange.Copy Destination:=Sheets("Sheet2").Range("A1") End If End Sub Nike "Kashyap" wrote: Hi, I need to copy rows where value of Col L matches with cell A1 and paste in a different sheet. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Nike..
Would you please help with another post of mine...? Macro to take cell ref of the object http://www.microsoft.com/communities...9-9a8428960f8e "Mike H" wrote: Hi, Right click the sheet tab with your source data and view code and paste the code below in. It copies to sheet2 so change to suit Sub delete_Me() Dim copyrange As Range lastrow = Cells(Cells.Rows.Count, "L").End(xlUp).Row Set MyRange = Range("L2:L" & lastrow) For Each c In MyRange If c = Range("A1").Value Then If copyrange Is Nothing Then Set copyrange = c.EntireRow Else Set copyrange = Union(copyrange, c.EntireRow) End If End If Next If Not copyrange Is Nothing Then copyrange.Copy Destination:=Sheets("Sheet2").Range("A1") End If End Sub Nike "Kashyap" wrote: Hi, I need to copy rows where value of Col L matches with cell A1 and paste in a different sheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Get last 6 rows in list where 1 cell matches certain criteria | New Users to Excel | |||
If cell 'a' matches cell 'b' then copy cell 'd' to cell 'e' | Excel Programming | |||
copy if data matches | Excel Worksheet Functions | |||
Delete rows if value matches | Excel Programming | |||
if cell value matches then copy another cell | Excel Programming |