#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default r1c1

Hi

Can anyone briefly explain to me how to use r1c1 reference
styles in VBA. I have tried the following:

ActiveSheet.range(destCol & X) = ("=IF(ISERROR(VLOOKUP(C"
& X & ",Pivot!$1:$65536,'Front End'![r9c11],0)),0,VLOOKUP
(C" & X & ",Pivot!$1:$65536,'Front End'![r9c11],0))")

Where x is the row number. This doesnt work. Do i need
to switcht the referencing to r1c1 before it will work?

TIA

Nath.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default r1c1

Nath,

You are basically there but you need to put the whole formulka in R1C1
notation, and tell VBA that you are setting an R1C1 formula

sFormula = "VLOOKUP(R" & x & "C3,Pivot!R1:R65536,'Front End'!r9c11,0)"
sFormula = "IF(ISERROR(" & sFormula & "),0," & sFormula & ")"
ActiveSheet.Range(destcol & x).FormulaR1C1 = "=" & sFormula


--

HTH

Bob Phillips

"nath" <n@n wrote in message ...
Hi

Can anyone briefly explain to me how to use r1c1 reference
styles in VBA. I have tried the following:

ActiveSheet.range(destCol & X) = ("=IF(ISERROR(VLOOKUP(C"
& X & ",Pivot!$1:$65536,'Front End'![r9c11],0)),0,VLOOKUP
(C" & X & ",Pivot!$1:$65536,'Front End'![r9c11],0))")

Where x is the row number. This doesnt work. Do i need
to switcht the referencing to r1c1 before it will work?

TIA

Nath.



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
R1C1 stacia Excel Discussion (Misc queries) 0 February 16th 10 06:19 PM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Discussion (Misc queries) 3 September 13th 07 08:31 AM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Worksheet Functions 3 September 13th 07 08:31 AM
R1C1 Arne Hegefors Excel Discussion (Misc queries) 1 August 18th 06 10:11 AM
A:1 now R1C1 Michael E W Excel Worksheet Functions 2 December 24th 05 11:38 PM


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