Originally Posted by
ayyappan80
the reason why its 0- is for presentation of positive and negative on summary sheet
If the pattern to have the formula result in negative is always the same, which is "0-",
then why don't you just do the thing which is the same thing on the code I added,
after I've found out that if the sheet name has space, the macro throw error ?
I add the code below
after you tell me that there is a sheet name with space.
A sheet name with space is causing Excel put ' sign before and after the sheet name in the formula.
So in order the code runs, the ' sign need to be replaced to nothing as in the code above.
Now if you want to put a negative result and if you consistent that you will always do it by add "0-"
Then you can insert one more code line to replace the "0-" into nothing.
But if later on you say that you want the result is (for example) from a multiplication,
so you alter the formula into something like this =0-123*Sheet4!$B$4,
then the code will AGAIN throw you an error.
Bookmarks