Thread
:
enter opposite number one row below
View Single Post
#
6
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
enter opposite number one row below
I thought I had done that ,1 ,"o"
Sub putnumbers()
For i = Cells(Rows.Count, "o").End(xlUp).Row To 1 Step -2
Cells(i + 1, "o") = -Cells(i, "o")
Next
End Sub
--
Don Guillett
SalesAid Software
"andresg1975" wrote in message
...
can u tell me which 1 should i change to replace for my column I
thanks
"Don Guillett" wrote:
try this. Notice the step -2
Sub putnumbers()
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -2
Cells(i + 1, 1) = -Cells(i, 1)
Next
End Sub
--
Don Guillett
SalesAid Software
"andresg1975" wrote in message
...
I didn't explain myself clear
the macro is only taking positive signs and converting them to minus
signs.
It should be a macro converting positive to minus, and minus to
positives.
thanks again.
at the end it shoul be like this
150
-150
-400
400
-250
250
150 change to -150, insert a row
-400 change to 400, insert a row
"Don Guillett" wrote:
change ,1 to ,"o"
Sub putnumbers()
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Cells(i, 1) 0 Then Cells(i + 1, 1) = -Cells(i, 1)
Next i
End Sub
--
Don Guillett
SalesAid Software
"andresg1975" wrote in message
...
Can someone help me on this.
lets say i have
column O
row 1 150
row 2
row 3 92
row 4
row 5 70
row 6
how can i create a macro that goes to column O, enters the value of
the
cell
above in this case 150, one row below having opposite sign -150,
insert
a
row
below, and continue the same procedure. In this case, making 92
as -92
one
row below and insert a new row, and so on. Thanks a lot.
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett