View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RPW RPW is offline
external usenet poster
 
Posts: 52
Default using code variable to write cell formula

Hi all,

The following gets a compile error expected:end of statement and the second
set of quotation marks are highligted.

uf = cellb.Row
Worksheets("Basic Pricing").Range("F202").Formula =
"=if(d2020,lookup(d202,'Materials & Multipliers'!$d5:$d"& uf & ",'Materials
& Multipliers'!$e5:$e"& uf & "),0)"

I've tried building the string step by step with (a variable uf) but the
cell formula doesn't update.

Worksheets("Basic Pricing").Range("F202").Formula = uf

Help with either or both would be much appreciated.

--
rpw