swaink
Active Member
- Joined
- Feb 15, 2002
- Messages
- 432
Hi All
I have reached a small hitch with using VBA to carry out a calulation.
In Cell D8 I have a date field and anchor my vba on that cell and use offset to achieve what I am aiming for.
All works well except for a percentage calulation when I divide cell D10 by D9 and place the value in cell D14 ("ActiveCell.Offset(6, 0).Value")
This is the line I use to do the calulation and I expect to see a percentage value such as 98.3 % but the end result shows as 9.893129770992370.00% and I can't see why
ActiveCell.Offset(6, 0).Value = (ActiveCell.Offset(2, 0).Value / ActiveCell.Offset(1, 0).Value) * 10 & Format("0.0", "Percent")
All advice appreciated
Kevin
I have reached a small hitch with using VBA to carry out a calulation.
In Cell D8 I have a date field and anchor my vba on that cell and use offset to achieve what I am aiming for.
All works well except for a percentage calulation when I divide cell D10 by D9 and place the value in cell D14 ("ActiveCell.Offset(6, 0).Value")
This is the line I use to do the calulation and I expect to see a percentage value such as 98.3 % but the end result shows as 9.893129770992370.00% and I can't see why
ActiveCell.Offset(6, 0).Value = (ActiveCell.Offset(2, 0).Value / ActiveCell.Offset(1, 0).Value) * 10 & Format("0.0", "Percent")
All advice appreciated
Kevin