VBA Formula Result Different Than Manual Formula Result

O

ob3ron02

I don't really understand your post, Don. Is what you're saying that
should write my code as follows (without the = sign inside the quote
for my string assignment)?
Code
-------------------
Dim ReportD As String
ReportD = "=IF(ISNA(MATCH(R[0]C[-2],PID!B:B,0))=FALSE, ""x"","""")"
Worksheets("Report").Range("D5").Offset(counter, 0).Formula = Report
-------------------
This just seems to put the string in the cells as text and no
formulas.

Thanks,

To
 
T

Tom Ogilvy

for the code shown:

Dim ReportD As String
ReportD = "=IF(ISNA(MATCH(R[0]C[-2],PID!B:B,0))=FALSE, ""x"","""")"
Worksheets("Report").Range("D5").Offset(counter, 0).Formula = ReportD

You have mixed R1C1 addressing and A1 addressing. Do one or the other. Don
appeared to see your requirement as being to calculate the result in VBA and
return it to the variable. It appears here that you want to put a formula
in a cell, so you need to retain the equal sign.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top