Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: June Carroll   on Nov 27 In MS Office Category.

  
Question Answered By: Jana Franklin   on Nov 27

Firstly, you "should" refer to the formula in a cell  by .Cells(i,j).Formula
You'll possibly get away without it, but you should be explicit in case
Excel has trouble deciding what you mean.

Secondly, your string to the right of the equals has quotes within the
quotes. If you want quotes as literals in a string you need to put two of
them at each place.

Thirdly, I think you'll find that #REF is fully in capitals.

But, most importantly, you are putting into the cell (or trying to) the
formula =Replace("#Ref",1, 10, "Autofilter"). You are not replacing the
formula with a minor variation, you are replacing it with a replace
statement.

My statement that does it - for A1 only - is

Cells(1, 1).Formula = Replace(Cells(1, 1).Formula, "#REF", "Autofilter")

You'd need to change the 1,1 back and put the dot before both of the Cells
calls, but that's pretty much what you'd want.

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Editing cell references w/ VBA Or get search suggestion and latest updates.


Tagged: