LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default Problem with line of code / syntax

I am having problems with syntax.

I use the code below to enter formulas into cells . It is embedded in a sub
routine.

The code works finr for the first formula line (cell.offset), but the whole
thing breaks down for the second formula line.

The VBA code doesnt like the parentheses (thinks its the end of the
statement) and it doesnt seem to like the use of specific cell references
either (M$4)

Range("AK18:AK77").Select
Selection.ClearContents

For Each cell In Range("AO18:AO77")
Select Case cell.Value
Case "1"

cell.Offset(, -4).FormulaR1C1 = "=RC[-9]&RC[-8]&RC[-7]&RC[-6]&RC[-5]&RC[-4]"
cell.Offset(, -1).FormulaR1C1 = "=IF(ISERROR(RC[-1]/M$4),"Data?",RC[-1]/M$4)"
End Select
Next

Can anyone help with suggestions as I have alot of other similar formulas to
add which also contain cell references (some on other sheets) and other
statements within parentheses.

Thanks,

Roger
 
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
Help with syntax in line of code pignick Excel Programming 4 July 30th 08 08:15 AM
Syntax problem with code - chip.gorma joe loyzaga Excel Programming 0 May 13th 08 12:20 AM
Syntax problem with code WLMPilot Excel Programming 7 March 15th 08 08:42 PM
Syntax problem with code WLMPilot Excel Discussion (Misc queries) 1 March 15th 08 07:07 PM
Syntax Problem with formula code Todd Huttenstine Excel Programming 7 May 10th 04 05:35 PM


All times are GMT +1. The time now is 01:48 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"