I need a macro that will if the Value of the cell is < 1 update that cell to 0. I tried using the below, and it didn't work
![]()
Please Login or Register to view this content.
I need a macro that will if the Value of the cell is < 1 update that cell to 0. I tried using the below, and it didn't work
![]()
Please Login or Register to view this content.
Last edited by jo15765; 02-28-2012 at 09:58 AM.
hi
it's non-sens
cell value could not be bigger then 1 and lower then 0 in the same time![]()
Please Login or Register to view this content.
try to use only one of those conditions
i.e.
![]()
Please Login or Register to view this content.
Best Regards
MaczaQ
---------------------------------------------------------------------------------------------------------------------------
If you are satisfied with the solution(s) provided, please mark your thread as Solved
If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
- This way you will add him some reputation points ... thanks in advance.
attach some sample workbook.
This code should not to change other cells - only those lower from 1
Attached is a workbook showing what problem I am running into
1 % is equal = 1/100 so maybe you should have following condition?
![]()
Please Login or Register to view this content.
That is removing the formula for the values that meet that condition and updating to 0, but it is also removing the value for the numbers that do not meet that condition
I think you asked for it - try to rebuild your question, because for now I don't know what are you realy expecting
If the value in cells D73:D83 is less than 1, I want to update the value of that cell to 0. I do not want the value of the cells that are greater than 1 to change at all. I want those cells to continue to display the data as they are.
Does it make a difference that the cells I want to update is a formula and they display a percentage?
The last code posted should do what you want as 1% is 0.01. If it is not, then please post a workbook.
Good luck.
Attachment 143465I thought I had a workbook posted, but your right I don't see it either. I am attaching a workbook now
The revised code works fine. The one issue you may have is that you are not displaying decimals, so in one instance your rounded values look like 1% but are actually 0.7% so the macro clears it. If you don't want that, then use:
![]()
Please Login or Register to view this content.
That got it!!! Thank you!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks