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: 36
Default R1C1 and A1 style conflict in formula problem

Hi the code below generates error 1004, i think it's because I'm mixing
formula styles. Is there any way to rewrite this formula and make it work?
thanks in advance

Sheets(CFPBEY).Select
Range("E11:E20000").ClearContents
ColLoc1 = pbeyeydesc - pbeydescchg
ColLoc2 = pbeyeydesc - pbeyorigtrdesc
Dim test As String
test = "=IF(RC[-" & ColLoc1 & "]<0,VLOOKUP(RC[-" & ColLoc1 & "],'" & RT &
"'!$A$5:$B$" & _
intUniqueTrDesc & ",2,FALSE),VLOOKUP(RC[-" & ColLoc2 & "],'" & RT &
"'!$A$5:$B$" & _
intUniqueTrDesc & ",2,FALSE))"

Sheets(CFPBEY).Range(Cells(StartRow, pbeyeydesc), Cells(intNumOfTrDesc +
HdrRow, pbeyeydesc)).Formula = test

'_
' "=IF(RC[-" & ColLoc1 & "]<0,VLOOKUP(RC[-" & ColLoc1 & "],'" & RT &
"'!$A$5:$B$" & _
' intUniqueTrDesc & ",2,FALSE),VLOOKUP(RC[-" & ColLoc2 & "],'" & RT &
"'!$A$5:$B$" & _
' intUniqueTrDesc & ",2,FALSE))"
 
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
Using INDIRECT & R1C1 Ref style Bassman62 Excel Worksheet Functions 5 November 5th 08 09:38 PM
Sum Indirect Using R1C1 Style Bam Excel Worksheet Functions 17 September 17th 08 03:04 AM
How do I change sheet notation from R1C1 style to A1 style in XL 2 Sherlock1506 Setting up and Configuration of Excel 1 December 5th 06 03:22 PM
How to use/evaluate another Cell Formula in R1C1 style Caio Milani[_2_] Excel Programming 2 November 7th 06 04:11 PM
can a1 reference style and r1c1 style be used in same formula? rjagga Excel Worksheet Functions 1 September 17th 06 10:58 AM


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