#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Using " in formula

Hello All,

I have a procedure to initialise each new sheet to a standard.

Part of the initialisation is to put a formula in a cell. Unfortunately this
formula contains ". (See below)

activecell.FormulaR1C1 =
"=OFFSET(Codes!E2,MATCH(MID(CELL("filename",A1),FI ND("]",CELL("filename",A1))+1,255),Codes!E:E)-2,-1)"

So the question is: How do I get the VBA to put this formula in the cell?

Thanks

Richard
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Using " in formula

By far the simplest is to record yourself entering the formula and you will
find the quotes double up. In this example the active cell was A2:-

ActiveCell.FormulaR1C1 = _

"=OFFSET(codes!RC[4],MATCH(MID(CELL(""filename"",R[-1]C),FIND(""]"",CELL(""filename"",R[-1]C))+1,255),codes!C[4])-2,-1)"

Mike

"Richard M Burton" wrote:

Hello All,

I have a procedure to initialise each new sheet to a standard.

Part of the initialisation is to put a formula in a cell. Unfortunately this
formula contains ". (See below)

activecell.FormulaR1C1 =
"=OFFSET(Codes!E2,MATCH(MID(CELL("filename",A1),FI ND("]",CELL("filename",A1))+1,255),Codes!E:E)-2,-1)"

So the question is: How do I get the VBA to put this formula in the cell?

Thanks

Richard

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Using " in formula

Thanks Mike,

That's what I needed to know.

Richard

"Mike H" wrote:

By far the simplest is to record yourself entering the formula and you will
find the quotes double up. In this example the active cell was A2:-

ActiveCell.FormulaR1C1 = _

"=OFFSET(codes!RC[4],MATCH(MID(CELL(""filename"",R[-1]C),FIND(""]"",CELL(""filename"",R[-1]C))+1,255),codes!C[4])-2,-1)"

Mike

"Richard M Burton" wrote:

Hello All,

I have a procedure to initialise each new sheet to a standard.

Part of the initialisation is to put a formula in a cell. Unfortunately this
formula contains ". (See below)

activecell.FormulaR1C1 =
"=OFFSET(Codes!E2,MATCH(MID(CELL("filename",A1),FI ND("]",CELL("filename",A1))+1,255),Codes!E:E)-2,-1)"

So the question is: How do I get the VBA to put this formula in the cell?

Thanks

Richard

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use "offset" function in "array formula"? hongguang Excel Discussion (Misc queries) 3 April 4th 07 12:04 AM
=IF(B1,"",SUMPRODUCT(--(B$1:B$5=""),--(A1<A$1:A$5))+1), Biff formula Rasoul Khoshravan Excel Worksheet Functions 1 October 24th 06 05:13 PM
Can you replace "TRUE" with " " in an exact formula? Sweetetc Excel Worksheet Functions 2 February 10th 06 01:11 PM
conditional formula to show "open" or "closed" SBS Excel Worksheet Functions 6 January 28th 06 01:48 AM
"IF"- "THEN" type Formula based on Null value Jay Excel Worksheet Functions 8 November 17th 05 09:05 AM


All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"