Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
wil4d
 
Posts: n/a
Default Create a Macro that will copy the rows that have a value < 0

How do I Create a Macro that will copy the rows that have a value < 0 and
paste them on anther worksheet
  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Create a Macro that will copy the rows that have a value < 0

Try something like the following. Change the lines marked with <<
to the appropriate ranges.

Dim DestRng As Range
Dim Rng As Range

Set DestRng = Worksheets("Sheet2").Range("A1") '<<
For Each Rng In Range("A1:A10") '<<
If Rng.Value < "" Then
Rng.EntireRow.Copy Destination:=DestRng
Set DestRng = DestRng(2, 1)
End If
Next Rng


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"wil4d" wrote in message
...
How do I Create a Macro that will copy the rows that have a
value < 0 and
paste them on anther worksheet



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
Deleting rows in a macro in Excel THEFALLGUY Excel Discussion (Misc queries) 4 December 23rd 05 01:59 PM
Macro to delete rows with same data Connie Martin Excel Worksheet Functions 12 November 22nd 05 01:18 PM
copy rows meeting criteria to another worksheet confused Excel Worksheet Functions 4 October 4th 05 11:51 AM
copy exact values from RangeA to Range B which has extra rows guptasa@gossami .com Excel Discussion (Misc queries) 1 May 16th 05 09:21 AM
Copy Paste macro GWB Direct Excel Discussion (Misc queries) 2 May 9th 05 03:31 PM


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