Using formula problem

J

Jeff

I am trying to use the following in Excel VBA;
xlApp.Selection.Range("A4", code).Formula =
"=LOOKUP(REPT("Z",255),B4:I4)"

If I leave off the formula portion the .formula expression is fine.
The problem I'm having is that I keep getting "Compile Error
Expected:)" But I have all of my brackets balanced.

Jeff
 
B

Bob Phillips

xlApp.Range("A4").Formula =
"=LOOKUP(REPT("Z",255),B4:I4)"

??

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Buster

I'm trying to copy text from the columns to the right of the cell for the
range B4:I4, using the repeat function inside of the lookup function such
that text in the character range from the letter Z to asci code 255.

When I type this out, the letter Z causes no problems if not enclosed by
quotation marks. However in order to function the Z must be enclosed in
qutation marks.

Jeff
 
B

Bob Phillips

xlApp.Range("A4").Formula = "=LOOKUP(REPT(""Z"",255),B4:I4)"


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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