Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to edit a formula.
I have an old lotus macro that I would like to reproduce in excel.
Specifically I would like to have a macro open a cell in an edit mode and have the cell be a formula of =round(/1.08,2) with the cursor sitting just in front of the division sign so that someone could enter a number and have it divide by 1.08. I and a coworker have been trying all sorts of things but none of them are working. -- Thanks, Jim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to edit a formula.
This seemed to work ok for me:
Option Explicit Sub testme01() Dim myRng As Range Dim myCell As Range Set myRng = Selection For Each myCell In myRng.Cells With myCell If .HasFormula Then .Formula = "=round((" & Mid(.Formula, 2) & ")/1.08,2)" Else .Formula = "=round(" & .Value & "/1.08,2)" End If End With Next myCell End Sub Select your range and test it out. It does all the cells that are selected. jimwood wrote: I have an old lotus macro that I would like to reproduce in excel. Specifically I would like to have a macro open a cell in an edit mode and have the cell be a formula of =round(/1.08,2) with the cursor sitting just in front of the division sign so that someone could enter a number and have it divide by 1.08. I and a coworker have been trying all sorts of things but none of them are working. -- Thanks, Jim -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with MACRO to Edit WORKDAY Formula? | Excel Discussion (Misc queries) | |||
Macro to edit formula | Excel Discussion (Misc queries) | |||
MACRO TO EDIT CELL FORMULA !! | Excel Programming | |||
macro to edit formula | Excel Programming | |||
macro to edit formula | Excel Programming |