![]() |
|
#1
|
|||
|
|||
|
Hi all,
I have a file with the name "FY 19-Budget (with macro extension). Within the file, I have three sheets with the following names: 130R 135R 140R From cell E4 to P45, I have numbers on it. Some of the cells also have the following values: "0.00" If possible, I would like to have a macro that will convert the values from positive to negative in all the cells from E4 to P45 (I guess anything greater than zero). I found the below code but don't know how to use it in my situation. Code:
Sub test()
For Each Cell In Range("a1:z100")
If Cell.Value > 0 Then
Cell.Value = cell.value * -1
End If
Next Cell
End Sub
To illustrate, for example, in cell E4, under sheet 130R, I have the following value: 1051.00 After conversion, the value in E4 will be, for example: -1051.00 Any questions, please let me know. As always, thank you for your support. Much appreciated, rsrasc |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Need Macro to Convert Text To Numbers in Multiple Sheets
|
rsrasc | Excel Programming | 4 | 04-11-2016 06:21 AM |
Excel VBA to convert number to negative
|
dakm63 | Excel Programming | 1 | 05-26-2015 10:49 AM |
Table cells with negative numbers being displayed in two lines
|
HankBrandenburg | Word Tables | 1 | 02-17-2014 03:04 PM |
| Custom formatting to make negative numbers show w/o negative sign on charts | todor | PowerPoint | 3 | 01-16-2013 03:45 AM |
How to add the plus sign (+) automatically for the numbers which are positive?
|
Jamal NUMAN | Excel | 2 | 05-01-2011 03:15 PM |