Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy Rows using criteria

Hi ,

I have a data with about 4500 rows and 12 columns. I would like to
copy only the rows where column C haven't "0" value.can someone hep me
with a macro ?


Example

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Copy Rows using criteria

Try this:

Sub Copy()
Dim lRow As Long, rng As Range, i As Range
lRow = Range("C65536").End(xlUp).Row
Set rng = Range(Cells(1, 3), Cells(lRow, 3))

a = 1
For Each i In rng
If i.Value < "0" Then
i.EntireRow.Copy Sheets(2).Rows(a)
a = a + 1
End If
Next i
End Sub

--
Dan

On Dec 17, 10:46 am, Carpe Diem wrote:
Hi ,

I have a data with about 4500 rows and 12 columns. I would like to
copy only the rows where column C haven't "0" value.can someone hep me
with a macro ?

Example

Thank you


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
Automatically copy rows based on criteria Jay Excel Discussion (Misc queries) 5 November 9th 07 07:55 PM
Copy rows to another sheet. Criteria = cells in column H is not em Henrik Excel Programming 0 May 10th 07 03:12 PM
Copy rows that meet a certain criteria James[_40_] Excel Programming 1 May 5th 06 11:31 PM
copy rows meeting criteria to another worksheet confused Excel Worksheet Functions 4 October 4th 05 11:51 AM
Copy Rows if Lookup Criteria Match vdoubleu Excel Discussion (Misc queries) 0 March 29th 05 06:43 PM


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