Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Condensing a data range with only a few nonzero values???

I have a large range (24 columns by 50 rows) and the majority of the cell
values are zero, but there are about 10-20 that are not. However, these
10-20 values change position depending on other data. Does anyone have a
macro that can find the cells that have values and put the values into the
first column of another worksheet?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Condensing a data range with only a few nonzero values???

Try something like

Dim Rng As Range
Dim Dest As Range
Set Dest = Worksheets("Sheet2").Range("A1")
For Each Rng In Range("A1:X50").Cells '<< Change range as
required
If Rng.Value < 0 Then
Dest.Value = Rng.Value
Set Dest = Dest(2, 1)
End If
Next Rng


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


"Travis.Broersma"
wrote in message
...
I have a large range (24 columns by 50 rows) and the majority of
the cell
values are zero, but there are about 10-20 that are not.
However, these
10-20 values change position depending on other data. Does
anyone have a
macro that can find the cells that have values and put the
values into the
first column of another 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
find and replace nonzero values with 1 Amylacc Excel Worksheet Functions 4 April 4th 23 10:53 AM
How to compute StDev of only nonzero entries in a range? Sam Excel Worksheet Functions 3 February 5th 09 01:27 AM
Address of last nonzero value in a range Ron Coderre Excel Worksheet Functions 0 August 7th 08 03:21 PM
Condensing a list of numbers into a range Grandpoobah Excel Discussion (Misc queries) 1 August 28th 06 02:50 AM
Running average without nonzero values or empty cells wjsubs[_3_] Excel Programming 1 July 8th 04 04:24 PM


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