Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default 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
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
SUMPRODUCT or SUMIF if any values in a range equal any values in another range PCLIVE Excel Worksheet Functions 3 July 15th 09 07:43 PM
Cond. Format Data Bars of range based on values of another range alexmo Excel Worksheet Functions 4 January 16th 09 04:03 AM
Searching a date range to output values according to a constant. Geebz Excel Discussion (Misc queries) 2 December 1st 06 09:34 AM
Searching a date range to output values according to a constant. daddylonglegs Excel Discussion (Misc queries) 0 November 30th 06 08:23 PM
Copying a particular range of values from one sheet to another in excel anoop_2000 Excel Programming 2 June 17th 04 03:46 AM


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