Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Syntax for a formulae in Visual Basic

Im trying to put a formulae into a spreadsheet in a program as thus:

ActiveCell.FormulaR1C1 = "=RC[6] & ""_"" & RC[7]"

This works fine but Id like to replace the numbers giving the columns with
variables i and j. I cant seem to get a syntax sorted that doesnt fall
over. Can anyone help?

Here's one variant that I tried: ActiveCell.FormulaR1C1 = "=RC[" & i & "]" &
"_" & "RC[" & j & "]" where i and j are variables. Clearly not doing
something right! Any help greatly appreciated,
--
thanks, Neil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Syntax for a formulae in Visual Basic


ActiveCell.FormulaR1C1 = "=RC[" & i & "] & ""_"" & RC[" & j & "]"

should work

Tim

"Highlystrung" wrote in message
...
I'm trying to put a formulae into a spreadsheet in a program as thus:

"=RC[6] & ""_"" & RC[7]"

This works fine but I'd like to replace the numbers giving the columns
with
variables i and j. I can't seem to get a syntax sorted that doesn't fall
over. Can anyone help?

Here's one variant that I tried: ActiveCell.FormulaR1C1 = "=RC[" & i & "]"
&
"_" & "RC[" & j & "]" where i and j are variables. Clearly not doing
something right! Any help greatly appreciated,
--
thanks, Neil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Syntax for a formulae in Visual Basic

Yes, it does. I'm sure I've tried this variant as I've tried many in my
frustration but many thanks anyway!
--
thanks, Neil


"Tim Williams" wrote:


ActiveCell.FormulaR1C1 = "=RC[" & i & "] & ""_"" & RC[" & j & "]"

should work

Tim

"Highlystrung" wrote in message
...
I'm trying to put a formulae into a spreadsheet in a program as thus:

"=RC[6] & ""_"" & RC[7]"

This works fine but I'd like to replace the numbers giving the columns
with
variables i and j. I can't seem to get a syntax sorted that doesn't fall
over. Can anyone help?

Here's one variant that I tried: ActiveCell.FormulaR1C1 = "=RC[" & i & "]"
&
"_" & "RC[" & j & "]" where i and j are variables. Clearly not doing
something right! Any help greatly appreciated,
--
thanks, Neil




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
Can I run Visual Basic procedure using Excel Visual Basic editor? john.jacobs71[_2_] Excel Programming 3 December 26th 05 02:22 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
visual basic pasting formulae bob Excel Programming 1 October 18th 04 05:37 PM
Help: Visual Basic Syntax Al[_12_] Excel Programming 7 November 3rd 03 10:53 AM
More Visual Basic Syntax Al[_12_] Excel Programming 2 November 3rd 03 07:25 AM


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

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"