#1   Report Post  
Posted to microsoft.public.excel.programming
AM AM is offline
external usenet poster
 
Posts: 41
Default copy cells

I need to copy cells from one worksheet to
another [same workbook], based on two conditions. The conditions are simple,
e.g. ISBLANK($A30) and $C30="OPEN", etc. The original column has 200 entries.
Only 50 of them may be copied in consecutive cells in a column on the new
worksheet.

Thanks for any help.
Atul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default copy cells

Sub CopyData()
Dim rng as Range, sh as worksheet
Dim rw as Long, cell as Range
with worksheets(1)
set rng = .range(.cells(2,1),.cells(2,1).End(xldown))
End with
set sh = Worksheets(2)
rw = 2
for each cell in rng
if len(trim(cell)) = 0 and cell.offset(0,2) = "OPEN" then
cell.Entirerow.copy sh.Cells(rw,1)
rw = rw + 1
end if
Next
End sub
--
Regards,
Tom Ogilvy


"AM" wrote:

I need to copy cells from one worksheet to
another [same workbook], based on two conditions. The conditions are simple,
e.g. ISBLANK($A30) and $C30="OPEN", etc. The original column has 200 entries.
Only 50 of them may be copied in consecutive cells in a column on the new
worksheet.

Thanks for any help.
Atul

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
How can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Excel Discussion (Misc queries) 3 March 23rd 10 02:38 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
macro needed to copy blocks of cells across to list of cells down piersonpro Excel Programming 3 March 28th 07 12:51 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy data into cells until changes trigger new copy mdeanda Excel Programming 2 April 25th 05 01:32 PM


All times are GMT +1. The time now is 04:17 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"