Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default copy to another sheet based on column value

Hi, Im trying to find a way (im guessing a macro) that I can copy all the
rows on a page that have "RES" as the value in the b column to another sheet,
pasting them starting in the first row that is open on the new sheet. Can
anyone help with this? It would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default copy to another sheet based on column value

Do you want a new sheet or do you want to append to the first blank row of an
existing sheet?

"Mike" wrote:

Hi, Im trying to find a way (im guessing a macro) that I can copy all the
rows on a page that have "RES" as the value in the b column to another sheet,
pasting them starting in the first row that is open on the new sheet. Can
anyone help with this? It would be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default copy to another sheet based on column value

Hi mike

Try this
http://www.rondebruin.nl/copy5.htm

Or this Add-in
http://www.rondebruin.nl/easyfilter.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Mike" wrote in message ...
Hi, Im trying to find a way (im guessing a macro) that I can copy all the
rows on a page that have "RES" as the value in the b column to another sheet,
pasting them starting in the first row that is open on the new sheet. Can
anyone help with this? It would be greatly appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default copy to another sheet based on column value

Here is some code that creates a new sheet for you

Public Sub CopyRows()
Dim wksToSearch As Worksheet
Dim wksToPaste As Worksheet
Dim strToFind As String
Dim rngToSearch As Range
Dim rngFound As Range
Dim rngPaste As Range
Dim strFirstAddress As String

strToFind = "RES"
Set wksToSearch = ActiveSheet
Set rngToSearch = wksToSearch.Range("B1").EntireColumn
Set wksToPaste = Worksheets.Add
Set rngPaste = wksToPaste.Range("A1")
Set rngFound = rngToSearch.Find(strToFind, , , xlPart)

If Not rngFound Is Nothing Then
strFirstAddress = rngFound.Address
Do
rngFound.EntireRow.Copy rngPaste
Set rngFound = rngToSearch.FindNext(rngFound)
Set rngPaste = rngPaste.Offset(1, 0)

Loop Until rngFound.Address = strFirstAddress

End If
End Sub

If this is a one of thing then doing a filter is going to be the easiest
though...

HTH

"Jim Thomlinson" wrote:

Do you want a new sheet or do you want to append to the first blank row of an
existing sheet?

"Mike" wrote:

Hi, Im trying to find a way (im guessing a macro) that I can copy all the
rows on a page that have "RES" as the value in the b column to another sheet,
pasting them starting in the first row that is open on the new sheet. Can
anyone help with this? It would be greatly appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default copy to another sheet based on column value

Just in case you would have been happy with any solution, you also had the
option of simply sorting the data on that column then copying the block that
meets your criteria.

You could also just filter on Col, B, use Edit / Go To / Special Cells /
Visible and then copy them to your new sheet.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Mike" wrote in message
...
Hi, Im trying to find a way (im guessing a macro) that I can copy all the
rows on a page that have "RES" as the value in the b column to another

sheet,
pasting them starting in the first row that is open on the new sheet. Can
anyone help with this? It would be greatly appreciated.



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
copy rows from one Data sheet to another sheet based on cell conte John McKeon Excel Discussion (Misc queries) 2 May 15th 10 06:49 AM
Search for rows in one sheet and copy into another sheet based on customer id [email protected] Excel Worksheet Functions 1 October 22nd 07 03:09 AM
Copy rows of one sheet into mutiple sheets based on column value Wesley Breshears Excel Discussion (Misc queries) 0 October 18th 06 03:19 PM
MACRO - copy rows based on value in column to another sheet Michael A Excel Discussion (Misc queries) 1 March 5th 05 02:15 AM
how to find and copy values on sheet 2, based on a list on sheet 1 evanmacnz Excel Programming 4 February 7th 05 08:33 PM


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

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"