Thread: X Cell Problem
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default X Cell Problem

What you have described is not really the way that macro's work. While you
can edit formulas you need to kind of build it more from scratch than have it
do an F4 3 times. Is your existing formula simply a referece to another cell?
If so then something like this will work

Sub EditFormula
activecell.formula = "=Trim($" & mid(activecell.formula, 2, 255) & ")"
End Sub
Changes =A1 to =Trim($A1)
--
HTH...

Jim Thomlinson


"Michael Conroy" wrote:

I am trying to speed up the repetitive tasks of editing a cell. My formula is
simply pulling the value from another file, (copy and paste value won't work
and is not dynamic). I need to copy this formula across eight columns but the
original has absolute valued to the first column and row. Here is what I want.

I want to have a macro that edits the cell, hits F4 three times, types a
close paren, jumps to the beginning of the cell, moves right one space, types
Trim(, then hits enter. I know I can do this to the first cell myself and
then copy it across, but this activity happens often and I want to learn the
commands. My Access skills don't translate and I want to learn a little VB in
Excel. Thanks for your help
--
Michael Conroy
Stamford, CT