Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying rows one at a time to another sheet ones a criteria has been forfilled


hello,

I want to set up a code that will search in a sheet for a certain value
within a single cell in a fixed column, once this criteria has been
done then this entire row must be copied into another sheet.
Does anybody know a good code for doing such an operation with a
minimum of code.

Regards,
Niek


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default copying rows one at a time to another sheet ones a criteria has been forfilled

Try this with your data in Sheet1
It will copy the row to sheet2 if "ron" is in the Acolumn

Sub copy_to_other_sheet()
Dim a As Long
Dim i As Long
With Sheets("sheet1")
i = .Cells(Rows.Count, "A").End(xlUp).Row
For a = 1 To i
If .Cells(a, "A").Value = "ron" Then .Cells(a, "A").Copy _
Sheets("sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Next a
End With
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"solo_razor" wrote in message ...

hello,

I want to set up a code that will search in a sheet for a certain value
within a single cell in a fixed column, once this criteria has been
done then this entire row must be copied into another sheet.
Does anybody know a good code for doing such an operation with a
minimum of code.

Regards,
Niek


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default copying rows one at a time to another sheet ones a criteria has been forfilled

Try this. Modify to suit
Sub findandcopy()
Columns("B").Find("x").EntireRow.Copy _
Sheets("sheet2").Range("a1")
End Sub

Here is one to delete the row
Sub findanddelete()
Columns("B").Find("x").EntireRow.Delete
End Sub

"solo_razor" wrote in message
...

hello,

I want to set up a code that will search in a sheet for a certain value
within a single cell in a fixed column, once this criteria has been
done then this entire row must be copied into another sheet.
Does anybody know a good code for doing such an operation with a
minimum of code.

Regards,
Niek


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



Reply
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
copying whole row to another sheet based on criteria on cell tabylee via OfficeKB.com Excel Discussion (Misc queries) 0 January 23rd 10 03:04 PM
Copying rows with specific criteria Secret Squirrel Excel Discussion (Misc queries) 2 July 27th 08 08:22 AM
Copying rows depending on criteria set? forevertrying Excel Discussion (Misc queries) 2 April 14th 08 03:00 PM
Copying line from one sheet to another based on given criteria Valerie Excel Worksheet Functions 2 August 2nd 06 11:02 PM
Copying whole rows based upon one criteria kirbster1973 Excel Discussion (Misc queries) 2 May 26th 05 10:00 PM


All times are GMT +1. The time now is 02:15 AM.

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

About Us

"It's about Microsoft Excel"