Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Pat
 
Posts: n/a
Default Is it possible to.........

Is it possible to return a cell to zero after it displays a minus number
result in a cell. ?

The minus result is the result of code being run and it can result in more
than one cell in a range eg A1:A10

I do not want a formula to be used.

Any pointers on this will be most appreciated.
Pat


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

I for one do not understand.

What exactly do you mean by '... after it displays a minus number result in
a cell...' and '... minus result is the result of code being run and it can
result in more than one cell in a range eg A1:A10...'?


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pat" wrote in message
...
Is it possible to return a cell to zero after it displays a minus number
result in a cell. ?

The minus result is the result of code being run and it can result in more
than one cell in a range eg A1:A10

I do not want a formula to be used.

Any pointers on this will be most appreciated.
Pat




  #3   Report Post  
Pat
 
Posts: n/a
Default

Hi Bob,

Ok, say for example:
A1 = -6
A4 = -21
A10 = -8

The above are the result of a calculation preformed with use of code. Once
the code completes I need some other way of returning A1, A4 & A10 to 0

I could custom filter column A to display any cells with a negative value
then just manually enter 0.
However I prefer to use another way, if that is possible.

Pat


"Bob Phillips" wrote in message
...
I for one do not understand.

What exactly do you mean by '... after it displays a minus number result

in
a cell...' and '... minus result is the result of code being run and it

can
result in more than one cell in a range eg A1:A10...'?


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pat" wrote in message
...
Is it possible to return a cell to zero after it displays a minus number
result in a cell. ?

The minus result is the result of code being run and it can result in

more
than one cell in a range eg A1:A10

I do not want a formula to be used.

Any pointers on this will be most appreciated.
Pat






  #4   Report Post  
Otto Moehrbach
 
Posts: n/a
Default

One way would be to write a macro to find all the negative entries and
replace them with 0. Another way is for you to select the range that
contains your numbers, negative ones as well as positive ones. Then do
Edit - Replace. Put "-*" without the quotes for the Find, and put "0"
without the quotes for the Replace With:. Post back if this doesn't work
for you. HTH Otto
"Pat" wrote in message
...
Hi Bob,

Ok, say for example:
A1 = -6
A4 = -21
A10 = -8

The above are the result of a calculation preformed with use of code. Once
the code completes I need some other way of returning A1, A4 & A10 to 0

I could custom filter column A to display any cells with a negative value
then just manually enter 0.
However I prefer to use another way, if that is possible.

Pat


"Bob Phillips" wrote in message
...
I for one do not understand.

What exactly do you mean by '... after it displays a minus number result

in
a cell...' and '... minus result is the result of code being run and it

can
result in more than one cell in a range eg A1:A10...'?


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pat" wrote in message
...
Is it possible to return a cell to zero after it displays a minus
number
result in a cell. ?

The minus result is the result of code being run and it can result in

more
than one cell in a range eg A1:A10

I do not want a formula to be used.

Any pointers on this will be most appreciated.
Pat








  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Pat,

Could you just run this macro at the end of your code?

Sub ClearNegatives()
Dim iLastRow As Long
Dim i As Long
iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
If IsNumeric(Cells(i,"A").Value) Then
If Cells(i,"A").Value < 0
Cells(i,"A").Value = 0
End If
End If
Next i
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pat" wrote in message
...
Hi Bob,

Ok, say for example:
A1 = -6
A4 = -21
A10 = -8

The above are the result of a calculation preformed with use of code. Once
the code completes I need some other way of returning A1, A4 & A10 to 0

I could custom filter column A to display any cells with a negative value
then just manually enter 0.
However I prefer to use another way, if that is possible.

Pat


"Bob Phillips" wrote in message
...
I for one do not understand.

What exactly do you mean by '... after it displays a minus number result

in
a cell...' and '... minus result is the result of code being run and it

can
result in more than one cell in a range eg A1:A10...'?


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pat" wrote in message
...
Is it possible to return a cell to zero after it displays a minus

number
result in a cell. ?

The minus result is the result of code being run and it can result in

more
than one cell in a range eg A1:A10

I do not want a formula to be used.

Any pointers on this will be most appreciated.
Pat








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



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