Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VB Code Corerection Part 2!!

Earlier Tom and Harald helped me with some code to come up with

Sub Dosomething()
Range ("B9").Select
Dim i As Integer
For i = 4 to 7
ActiveCell.FormulaR1C1 = "R[" & -i & "]C[-1]"
Msgbox Activecell.formula
Next i
End Sub

However I now get the formula ( R[-7][4]) in B9 and not the value of
the resulting formula.
Any more help greatly appreciated

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default VB Code Corerection Part 2!!

Sub Dosomething()
Range ("B9").Select
Dim i As Integer
For i = 4 to 7
ActiveCell.FormulaR1C1 = "=R[" & -i & "]C[4]"
ActiveCell.Value = ActiveCell.Value
Msgbox "Value in B9 is " & ActiveCell.Value & vbnewline & _
"Value came from " & Range("B9").Offset(-i,4).Address(0,0,xlA1)
Next i
End Sub

--
Regards,
Tom Ogilvy


"RichIT" wrote:

Earlier Tom and Harald helped me with some code to come up with

Sub Dosomething()
Range ("B9").Select
Dim i As Integer
For i = 4 to 7
ActiveCell.FormulaR1C1 = "R[" & -i & "]C[-1]"
Msgbox Activecell.formula
Next i
End Sub

However I now get the formula ( R[-7][4]) in B9 and not the value of
the resulting formula.
Any more help greatly appreciated

Thanks


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
Code to get text from part of a cell Keenman Excel Worksheet Functions 3 April 27th 06 04:41 AM
Bolding Part Of A Title By Code.... Bob Barnes Charts and Charting in Excel 7 October 29th 05 02:40 AM
part of a code not being executed Valeria Excel Programming 2 September 28th 05 07:55 AM
Hiding Part of the VBA Code Matt Excel Programming 5 June 7th 04 07:07 PM
Code and data part deux Terry von Gease Excel Programming 1 August 20th 03 07:48 AM


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