Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Insert Row when zero or Positive value

Hi,

I have sorted a collumn in ascending value from negative to positive, I want
to insert a row when the change in the value is zero or greater. i.e

-2
-1
0
1

Becomes

-2
-1

0
1

The Collumn changes in length and sometimes there maybe no negative numbers
and sometimes there may be no positve numbers

Can sombody Please help me Thanks in advance

Darren

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200603/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Insert Row when zero or Positive value

assume column 3 (C)

Sub AddRow()
Dim col as Long, i as long
Dim lastrow as Long
col = 3
lastrow=cells(rows.count,col).End(xlup).row
for i = lastrow to 2 step -1
if cells(i-1,col) < 0 then
rows(i).Insert
exit sub
end if
Next
End Sub

--
Regards,
Tom Ogilvy


"FIRSTROUNDKO via OfficeKB.com" <u15639@uwe wrote in message
news:5d69e9a1d65c3@uwe...
Hi,

I have sorted a collumn in ascending value from negative to positive, I

want
to insert a row when the change in the value is zero or greater. i.e

-2
-1
0
1

Becomes

-2
-1

0
1

The Collumn changes in length and sometimes there maybe no negative

numbers
and sometimes there may be no positve numbers

Can sombody Please help me Thanks in advance

Darren

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200603/1



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert Row when zero or Positive value

sorry if u get u reply me back..

FIRSTROUNDKO via OfficeKB.com wrote:

Hi,

I have sorted a collumn in ascending value from negative to positive, I want
to insert a row when the change in the value is zero or greater. i.e

-2
-1
0
1

Becomes

-2
-1

0
1

The Collumn changes in length and sometimes there maybe no negative numbers
and sometimes there may be no positve numbers

Can sombody Please help me Thanks in advance

Darren

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200603/1


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
Subtracting positive amts from negative and positive from positive bwbmom Excel Worksheet Functions 3 February 12th 10 03:15 PM
Sum only positive Arne Hegefors Excel Worksheet Functions 2 January 25th 07 11:04 AM
FIND POSITIVE VALUE FIRSTROUNDKO via OfficeKB.com Excel Discussion (Misc queries) 2 March 23rd 06 01:43 AM
Formula to make Negative Values Positive & Positive Values Negative? mustard Excel Discussion (Misc queries) 4 September 26th 05 10:05 PM
positive integer? JZip Excel Discussion (Misc queries) 2 January 7th 05 06:37 PM


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