Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lee Lee is offline
external usenet poster
 
Posts: 33
Default Formula Replacement

I have a worksheet that I need to replace the formula in
numerous cells. Below is a portion of the SUB I set up to
replace the formula in one of the cells

Sub Discrete_Update()
.......
Range("E3").Select
ActiveCell.FormulaR1C1 = _
"=IF('BOE-Data & Text'!
L14<""Discrete"","""",Task_Start_Date)"
.......
End Sub

It replaces the formula but places tic marks around the
cell address (L14). =IF('BOE-Data &
Text'!'L14'<"Discrete","",Task_Start_Date)

This causes the cell to display #Name?. As soon as I go
to the cell and remove the tic marks the formula works
fine.

Any ideas why this is happening and what I can do to
correct it?

Thanks,

Lee


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formula Replacement

Range("E3").Formula = _
"=IF('BOE-Data & Text'!L14<""Discrete"","""",Task_Start_Date)"

Since your reference is in A1, not R1C1 use Just formula rather than
formulaR1C1

--
Regards,
Tom Ogilvy


"Lee" wrote in message
...
I have a worksheet that I need to replace the formula in
numerous cells. Below is a portion of the SUB I set up to
replace the formula in one of the cells

Sub Discrete_Update()
.......
Range("E3").Select
ActiveCell.FormulaR1C1 = _
"=IF('BOE-Data & Text'!
L14<""Discrete"","""",Task_Start_Date)"
.......
End Sub

It replaces the formula but places tic marks around the
cell address (L14). =IF('BOE-Data &
Text'!'L14'<"Discrete","",Task_Start_Date)

This causes the cell to display #Name?. As soon as I go
to the cell and remove the tic marks the formula works
fine.

Any ideas why this is happening and what I can do to
correct it?

Thanks,

Lee




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Formula Replacement

how about

[a1:a20].Copy [c1]

which will copy the contents of a1:a20 (containing the new
formulas) to c1 to c20 (containing the formulas to be
replaced)

-----Original Message-----
I have a worksheet that I need to replace the formula in
numerous cells. Below is a portion of the SUB I set up

to
replace the formula in one of the cells

Sub Discrete_Update()
.......
Range("E3").Select
ActiveCell.FormulaR1C1 = _
"=IF('BOE-Data & Text'!
L14<""Discrete"","""",Task_Start_Date)"
.......
End Sub

It replaces the formula but places tic marks around the
cell address (L14). =IF('BOE-Data &
Text'!'L14'<"Discrete","",Task_Start_Date)

This causes the cell to display #Name?. As soon as I go
to the cell and remove the tic marks the formula works
fine.

Any ideas why this is happening and what I can do to
correct it?

Thanks,

Lee


.

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
bulk replacement of cell reference within formula Twishlist Excel Worksheet Functions 3 April 4th 23 12:43 PM
Value Replacement palups Excel Worksheet Functions 6 November 20th 09 02:38 AM
Replacement Vlookup Formula Anto111 Excel Discussion (Misc queries) 2 August 26th 08 10:34 PM
Replacement mowen Excel Discussion (Misc queries) 1 September 7th 05 09:01 PM
Replacement CD Greg Maloney Excel Programming 0 June 18th 04 11:29 AM


All times are GMT +1. The time now is 04:11 PM.

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

About Us

"It's about Microsoft Excel"