Thread: Macro Help
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default Macro Help

That's quite another thing:
Range("AA2:AA" & lngRow).Formula = _
"=VLOOKUP(P2,PriceRanking,2,10)+VLOOKUP(X2,MarketS hare,2,10)+COUNTIF(Q2:T2,""Y"")*5"

Clear in your example usage of strFormula5 and strFormula52!

Regards,
Stefi

€˛Kim€¯ ezt Ć*rta:

My original formulas is something like:

strFormula5 =
"=(VLOOKUP(P2,PriceRanking,2,10))+(VLOOKUP(X2,Mark etShare,2,10))+(COUNTIF(Q2:T2,"Y")*5)"
Range("AA2:AA" & lngRow).Formula = strFormula2
Range("AA2:AA" & lngRow).NumberFormat = "#,##0_ ;[Red]-#,##0 "

So how should I change them ?

"Stefi" wrote:

Maybe you mean this:

x = WorksheetFunction.VLookup(Range("P2"), Range("PriceRanking"), 2, 10) + _
WorksheetFunction.VLookup(Range("X2"), Range("MarketShare"), 2, 10) + _
WorksheetFunction.CountIf(Range("Q2:T2"), "Y") * 5
Regards,
Stefi

€˛Kim€¯ ezt Ć*rta:

I have this formulas in Excel but I guess it doesn't work the same in macro.
Can someone pls help

=(VLOOKUP(P2,PriceRanking,2,10))+(VLOOKUP(X2,Marke tShare,2,10))+(COUNTIF(Q2:T2,"Y")*5)

Thanks.
Kim