Exporting Document Information to Excel - Using Variable in Formula

Exporting Document Information to Excel - Using Variable in Formula

eric.frissell26WKQ
Advocate Advocate
284 Views
2 Replies
Message 1 of 3

Exporting Document Information to Excel - Using Variable in Formula

eric.frissell26WKQ
Advocate
Advocate

Hi, I've got a macro that I'm working on (which works well) except for 1 line which is trying to use an integer in a formula.  The line is 

Range("Z2:Z & lastRow).Formula = "=ISNUMBER(SEARCH(-" & MatTypeIdentifier & ",RIGHT(B2,4)))"

 

I've seen people recommend double quotes but that results in a compile error in the Inventor VBA.  Anyone have any suggestions?  Seems there's gotta be a way which allows this to compile.

0 Likes
Accepted solutions (1)
285 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @eric.frissell26WKQ.

Just a couple quick questions/suggestions.

Was this:

Range("Z2:Z & lastRow)

supposed to be like this: (added an extra quotation mark ("))

Range("Z2:Z" & lastRow)

Also, to avoid having to use 'double quotation marks', you might be able to use Char(34), which represents the single quote mark character (Link1, Link2).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

eric.frissell26WKQ
Advocate
Advocate

Thanks!  That's a great idea, I'll have to try it this way to see if that works otherwise it's going to be a mess of cells and concatanating.  You'd think there'd be a way to do it but it is what is.  And you're right about the correction, must have missed it

0 Likes