How about incorporating the ROUND function?
This will lose the accuracy though.VB:Worksheets(t1dsheet).Cells(row, col).Value = "=Round((R[-53]C/R[-1]C)*100,-1)"
Alastair
Please can someone tell me how I could change this code to display value with 1 decimal place.
The value currently displayed in the cell is 33.01684963 but I would like it to show 30.0VB:Worksheets(t1dsheet).Cells(row, col).Value = "=(R[-53]C/R[-1]C)*100" row = row + 1
thanks John
How about incorporating the ROUND function?
This will lose the accuracy though.VB:Worksheets(t1dsheet).Cells(row, col).Value = "=Round((R[-53]C/R[-1]C)*100,-1)"
Alastair
Einstein:
Things should be made as simple as possible, but not any simpler
Be sure to check out TemplateZone for all your Microsoft Office Needs.
Get OfficeReady Professional 3.0 here!
hmm, thats strange, the cell now displays Round((R[-53]C/R[-1]C)*100,-1)and hasnt made the calculation, any ideas?
Works perfectly for me. Does the cell have "=" at the front?
Try usinginsteadVB:Worksheets(t1dsheet).Cells(row, col).FormulaR1C1= "=Round((R[-53]C/R[-1]C)*100,-1)"
Alastair
Einstein:
Things should be made as simple as possible, but not any simpler
Be sure to check out TemplateZone for all your Microsoft Office Needs.
Get OfficeReady Professional 3.0 here!
ok that works thanks. I have changed the -1 to -.1 which seems to increases the accuracy a little.
If you don't want to lose accuracy you can use this line of code after you have inserted your original formula
This retains 33.01684963 but will simply display 33.0VB:Worksheets(t1dsheet).Cells(row, col).NumberFormat = "0.0"
Regards,
Mark.
Thanks Mark, that has resolved my problem
John
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks