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

I have two sheets in the same workbook. In the first sheet, I'm trying to
programmatically populate cells with formulae to insure the correct formula
is always in the cells. The cell is too the left of a MSQuery, and the
formulae are not copying down along with the query refresh. When the code
runs, I'm getting a <run time error at this line.

Range("A2").FormulaR1C1 =
"=UPPER(IF(ISERROR(VLOOKUP(RC[8],JobNotes!C[2]:C[6],2,FALSE)),"",IF(VLOOKUP(
RC[8],JobNotes!C[2]:C[6],2,FALSE)<"",VLOOKUP(H2,JobNotes!C[2]:C[6],2,FALSE)
,"")))"

I'm looking for the value found in the current sheet current row column "H",
to see if its in sheet <JobNotes column array "B:F", and if found, return
the contents of the cell in the second column of the array.

--
D.S.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default FormulaR1C1

When you include double quotes in your formula assignment, you have to double up
on them.

Range("A2").FormulaR1C1 = _
"=UPPER(IF(ISERROR(VLOOKUP(RC[8],JobNotes!C[2]:C[6],2,FALSE))," _
& """"",IF(VLOOKUP(RC[8],JobNotes!C[2]:C[6],2,FALSE)<""""," _
& "VLOOKUP(H2,JobNotes!C[2]:C[6],2,FALSE),"""")))"



"D.S." wrote:

I have two sheets in the same workbook. In the first sheet, I'm trying to
programmatically populate cells with formulae to insure the correct formula
is always in the cells. The cell is too the left of a MSQuery, and the
formulae are not copying down along with the query refresh. When the code
runs, I'm getting a <run time error at this line.

Range("A2").FormulaR1C1 =
"=UPPER(IF(ISERROR(VLOOKUP(RC[8],JobNotes!C[2]:C[6],2,FALSE)),"",IF(VLOOKUP(
RC[8],JobNotes!C[2]:C[6],2,FALSE)<"",VLOOKUP(H2,JobNotes!C[2]:C[6],2,FALSE)
,"")))"

I'm looking for the value found in the current sheet current row column "H",
to see if its in sheet <JobNotes column array "B:F", and if found, return
the contents of the cell in the second column of the array.

--
D.S.


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default FormulaR1C1

And from your other thread, don't forget to change H2 to r1c1 notation.

Dave Peterson wrote:

When you include double quotes in your formula assignment, you have to double up
on them.

Range("A2").FormulaR1C1 = _
"=UPPER(IF(ISERROR(VLOOKUP(RC[8],JobNotes!C[2]:C[6],2,FALSE))," _
& """"",IF(VLOOKUP(RC[8],JobNotes!C[2]:C[6],2,FALSE)<""""," _
& "VLOOKUP(H2,JobNotes!C[2]:C[6],2,FALSE),"""")))"

"D.S." wrote:

I have two sheets in the same workbook. In the first sheet, I'm trying to
programmatically populate cells with formulae to insure the correct formula
is always in the cells. The cell is too the left of a MSQuery, and the
formulae are not copying down along with the query refresh. When the code
runs, I'm getting a <run time error at this line.

Range("A2").FormulaR1C1 =
"=UPPER(IF(ISERROR(VLOOKUP(RC[8],JobNotes!C[2]:C[6],2,FALSE)),"",IF(VLOOKUP(
RC[8],JobNotes!C[2]:C[6],2,FALSE)<"",VLOOKUP(H2,JobNotes!C[2]:C[6],2,FALSE)
,"")))"

I'm looking for the value found in the current sheet current row column "H",
to see if its in sheet <JobNotes column array "B:F", and if found, return
the contents of the cell in the second column of the array.

--
D.S.


--

Dave Peterson


--

Dave Peterson

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
ActiveCell.FormulaR1C1 Rick Excel Discussion (Misc queries) 3 March 28th 10 10:36 PM
reference to other worksheets in FormulaR1C1 Stefi Excel Discussion (Misc queries) 6 May 25th 05 09:01 AM
FormulaR1C1 D.S.[_3_] Excel Programming 0 January 1st 04 09:12 PM
FormulaR1C1 aapp81[_22_] Excel Programming 3 December 3rd 03 10:47 PM
ActiveCell.FormulaR1C1 Leif Rasmussen Excel Programming 1 October 16th 03 09:46 AM


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