View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.misc
Peter[_17_] Peter[_17_] is offline
external usenet poster
 
Posts: 1
Default How to copy all rows that contain a certain criteria to a new sheet?


Simon,

Very many thanks - and to P45cal too - for your expertise.

I'm beginning to understand and it works! Thank you:Bgr

I've now developed the workbook to run additional macro's & procedures
to create further 'reports' (I now have three, all of which produce what
I want) and it has crossed my mind that there may be a VBA method that
when run, it requests which report is required i.e. 'Vouchers',
'Subscriptions' etc.

Do you know if this is possible? If so, any advice/code gratefully
received!

Enjoy the weekend

Regards

Peter

Simon Lloyd;459831 Wrote:
You also need to look at this line:

Code:
--------------------
For Each MyCell In Sheets(Sh.Name).Range("G1:G" & Sheets(Sh.Name).Range("D" & Rows.Count).End(xlUp).Row)


--------------------
this will give you a workable range of G1:G and the number of used

rows in column D, that is to say if you have 25 enties in coulmn D
your range would be G1:G25 and not the amount of rows in coulmn G. but
no matter what that statement says that you ARE processing column G!



--
Peter
------------------------------------------------------------------------
Peter's Profile: http://www.thecodecage.com/forumz/member.php?userid=687
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125534