Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default removing data

Hi all,
I need your help!

I have a column of data that goes up, down, up, down... and finally
increases to a maximum. I need to remove the up and down portion to keep only
the final increase...

Any ideas how to do that?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default removing data

This is not a very simple problem. The issue is defining the last minimum.
It depends on your data when and how to define the lat minimum. Can you help?

"Lucile" wrote:

Hi all,
I need your help!

I have a column of data that goes up, down, up, down... and finally
increases to a maximum. I need to remove the up and down portion to keep only
the final increase...

Any ideas how to do that?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default removing data

Here we start at the bottom of a column and work upward. We check that the
data is increasing (moving downwards). When we find the breakpoint, we
delete all cells above the point.

Sub lucile()
n = Cells(Rows.Count, "A").End(xlUp).Row
v = Cells(n, "A").Value
For i = n - 1 To 1 Step -1
If v < Cells(i, "A").Value Then
Exit For
Else
v = Cells(i, "A").Value
End If
Next
Range("A1:A" & i).Delete Shift:=xlUp
End Sub

--
Gary''s Student - gsnu200823


"Lucile" wrote:

Hi all,
I need your help!

I have a column of data that goes up, down, up, down... and finally
increases to a maximum. I need to remove the up and down portion to keep only
the final increase...

Any ideas how to do that?
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default removing data

It was what I was thinking. Finding the last minimum is the best option. But
how do you find it!? Because it is not the minimum of the columns.

What else do you need to know?

"Joel" wrote:

This is not a very simple problem. The issue is defining the last minimum.
It depends on your data when and how to define the lat minimum. Can you help?

"Lucile" wrote:

Hi all,
I need your help!

I have a column of data that goes up, down, up, down... and finally
increases to a maximum. I need to remove the up and down portion to keep only
the final increase...

Any ideas how to do that?
Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default removing data

Tightening up your code just a little bit...

Sub lucile()
Set R = Cells(Rows.Count, "A").End(xlUp)
For i = R.Row - 1 To 1 Step -1
If Cells(i, "A").Offset(1).Value < Cells(i, "A").Value Then Exit For
Next
Range("A1:A" & i).Delete Shift:=xlUp
End Sub

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
Here we start at the bottom of a column and work upward. We check that
the
data is increasing (moving downwards). When we find the breakpoint, we
delete all cells above the point.

Sub lucile()
n = Cells(Rows.Count, "A").End(xlUp).Row
v = Cells(n, "A").Value
For i = n - 1 To 1 Step -1
If v < Cells(i, "A").Value Then
Exit For
Else
v = Cells(i, "A").Value
End If
Next
Range("A1:A" & i).Delete Shift:=xlUp
End Sub

--
Gary''s Student - gsnu200823


"Lucile" wrote:

Hi all,
I need your help!

I have a column of data that goes up, down, up, down... and finally
increases to a maximum. I need to remove the up and down portion to keep
only
the final increase...

Any ideas how to do that?
Thanks


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
Moving data from one worksheet to another whilst removing the data Dobbin0_4[_2_] Excel Discussion (Misc queries) 2 September 17th 08 03:31 PM
Removing Data Tables formed from importing data from Access Andrea Jones Excel Discussion (Misc queries) 0 April 10th 08 12:01 PM
Removing hyperlink without removing the font settings /border sett San Excel Programming 2 September 27th 07 04:37 PM
Removing lines of data that do not contain required data (macro) Sean[_7_] Excel Programming 1 May 21st 04 03:53 PM
Scanning for Duplicate Data in a Column, Merging Data and Finally Removing All Duplicates...? : VB : Excel Programming 2 August 24th 03 02:22 PM


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