VBA Statement

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

I have a worksheet with 12 months. Some cells are in the
negative. What I would like to do with a VBA statement is
to go to another cell and if any month is equal to less
than zero put in OVER, else actual data.

Example:
J F M A M J J A S O N D
-1 2 3 -5 4 6 -8 9 10 -2 3 -8

= over

Thanks
Frank
 
Frank,

Use an equation in the other cell.

=IF(Cell Value <0,"Over",Cell Value)

So,
If your months are in cells A1 to L1
and your data is in cells A2 to L2
and your equations are in cells A3 to L3
Then cell A3 would contain =IF(A2<0,"Over",A2)

Put the equation in cell A3 and copy it to the other cells B3 to L3.

You get:

F M A M J J A S O N
D
2 3 -5 4 6 -8 9 10 -2
3 -8
2 3 Over 4 6 Over 9 10 Over 3
Over


Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Scrabble Value calculation for Welsh words 0
How do I create a moving average in Excel? 9
Graphs 1
combining several lists into one? 1
Add Cells error 2
Warning with near date 4
Formula Problem 2
Excel Help with dates 2

Back
Top