Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching a range and copying values into a new range.... **Please help** :(
Hi all. Can someone help me with a problem I have. Working in Excel, I have range (B12:E15) that looks like: Date Consumption Limit Excess 01/01/04 1100 1000 100 02/01/04 980 1000 0 03/01/04 760 1000 0 04/01/04 1200 1000 200 What I need is code that will search through the column calle 'Excess', and for any values that are greater than 0, copy the entir row (values only, not formatting, or equations that may be behind th scenes) into a new range starting at G12. The code will search each ro of the data and for any other rows that have an 'excess', VB will past it immediately beneath any existing entires in the new range. What want to be left with is: Date Consumption Limit Excess 01/01/04 1100 1000 100 04/01/04 1200 1000 200 I hope that anyone can help with this as im brand new to VB. I've bee searching many forums for people asking similar questions, but i' having a hard time of it. Thank -- Lanci ----------------------------------------------------------------------- Lancia's Profile: http://www.excelforum.com/member.php...fo&userid=1482 View this thread: http://www.excelforum.com/showthread.php?threadid=26453 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching a range and copying values into a new range.... **Please help** :(
Lancia, try this for starters:
Sub CopyExcess() Range("B12").CurrentRegion.Select Selection.AutoFilter Field:=4, Criteria1:="0" Selection.Copy Range("G12").PasteSpecial Paste:=xlValues Application.CutCopyMode = False Selection.AutoFilter Columns("G:G").NumberFormat = "m/d/yyyy" End Sub Mike F "Lancia" wrote in message ... Hi all. Can someone help me with a problem I have. Working in Excel, I have a range (B12:E15) that looks like: Date Consumption Limit Excess 01/01/04 1100 1000 100 02/01/04 980 1000 0 03/01/04 760 1000 0 04/01/04 1200 1000 200 What I need is code that will search through the column called 'Excess', and for any values that are greater than 0, copy the entire row (values only, not formatting, or equations that may be behind the scenes) into a new range starting at G12. The code will search each row of the data and for any other rows that have an 'excess', VB will paste it immediately beneath any existing entires in the new range. What I want to be left with is: Date Consumption Limit Excess 01/01/04 1100 1000 100 04/01/04 1200 1000 200 I hope that anyone can help with this as im brand new to VB. I've been searching many forums for people asking similar questions, but i'm having a hard time of it. Thanks -- Lancia ------------------------------------------------------------------------ Lancia's Profile: http://www.excelforum.com/member.php...o&userid=14823 View this thread: http://www.excelforum.com/showthread...hreadid=264537 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SUMPRODUCT or SUMIF if any values in a range equal any values in another range | Excel Worksheet Functions | |||
Cond. Format Data Bars of range based on values of another range | Excel Worksheet Functions | |||
Searching a date range to output values according to a constant. | Excel Discussion (Misc queries) | |||
Searching a date range to output values according to a constant. | Excel Discussion (Misc queries) | |||
Copying a particular range of values from one sheet to another in excel | Excel Programming |