Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to edit a formula in excel?
I am trying to come up with some code that would take a formula and
edit to put in the ROUND function to round the result to 2 places. Thank you for any ideas. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to edit a formula in excel?
Take a look at this article in the archives:
http://groups.google.com/group/micro...browse_thread/ thread/a1c45338385e0fff/0afe4bc0c46218c8 In article .com, wrote: I am trying to come up with some code that would take a formula and edit to put in the ROUND function to round the result to 2 places. Thank you for any ideas. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to edit a formula in excel?
If having problems, try http://tinyurl.com/cxupr
-- HTH RP (remove nothere from the email address if mailing direct) "JE McGimpsey" wrote in message ... Take a look at this article in the archives: http://groups.google.com/group/micro...browse_thread/ thread/a1c45338385e0fff/0afe4bc0c46218c8 In article .com, wrote: I am trying to come up with some code that would take a formula and edit to put in the ROUND function to round the result to 2 places. Thank you for any ideas. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to edit a formula in excel?
Range("b1").Formula = "=round(" & Range("A1").Value & ",2)"
would take the value of a1 and round it to 2 places and put the result in b1 -- Gary wrote in message oups.com... I am trying to come up with some code that would take a formula and edit to put in the ROUND function to round the result to 2 places. Thank you for any ideas. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to edit a formula in excel?
Thanks Gary, it works on one enty, is there a way I can apply it to a
range of highlighted cells? I tried the other reference given but I couldn't make it work. Thanks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to edit a formula in excel?
see if this works for you
Option Explicit Dim cell As Range Sub RoundNumbers() For Each cell In Selection cell.Formula = "=round(" & cell.Value & ",2)" Next End Sub -- Gary wrote in message oups.com... Thanks Gary, it works on one enty, is there a way I can apply it to a range of highlighted cells? I tried the other reference given but I couldn't make it work. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I view and edit the source code for a Chart in Excel 2003? | Charts and Charting in Excel | |||
i edit a formula (excel) then it displays formula not answer | Excel Discussion (Misc queries) | |||
edit formula bar in excel 2003? | New Users to Excel | |||
Excel VBA macro - need to edit code to skip a year | Excel Programming | |||
Code Edit | Excel Programming |