Change a formula in VBA
Excellent, Dave, this does exactly what I asked for. Thanks!
"Dave Peterson" schreef in bericht
...
dim myCell as range
set mycell = activesheet.range("L1")
if mycell.hasformula then
mycell.formula = "=trim(" & mid(mycell.formula,2) & ")"
end if
Mahr Yon wrote:
Can anyone help with this problem:
I am trying to write a macro to change a formula in a cell and place the
new
formula in the same cell.
For instance:
Cel L1 in a worksheet contains: ='C:\TEST\[file.xls]data'!J7
By hand I can change this in: = TRIM('C:\TEST\[file10.xls]data'!J7)
which
removes excess spaces.
How must I do this in a macro?
Thanks in advance
MahrYon
--
Dave Peterson
|