Need formula or code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello -

I have a formula in A2:A500. I need to put the value of that formula (in
other words, the text it generates) into P2:P500.

What's the best way to accomplish this?

Any help will be greatly appreciated!
 
P2: = A2

and copy down.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
In Excel,
Select A2:A500
Edit/Copy (ctrl-C)
Select P2
Edit/Paste Special/Values


In VBA:
Range("P2:P500").Value = Range("A2:A500").Value
 
Hi Andrew -

Thank you for your response.

I need code or a formula, because this is for other users.

In particular, if I use VBA, I need to know what event to put it in.

If there is a formula that could accomplish this, it would be easier;
however, I don't know if one exists.
 
Hi Bob -

Thank you for responding.

Unless I'm missing something, I couldn't get your formula to work!
 
Bob offered this

P2: = A2

If you put in P2:=A2

then drop the P2: and use =A2

HTH
Regards,
Howard
 
will this work?

Sub copy_Values()
Range("P2:P500") = Range("a2:a500").Value
End Sub
 
Thanks!

Boy, was I overcomplicating this! I automatically assumed if I didn't
somehow refer to "value," that it would just copy the formula.

Thanks again for solving my problem -- works beautifully!
 
Thanks for your response, Gary! The post above solved the problem quite
simply.

You did the same thing I attempted to do and wasn't satisfied with --
created code. It works, but I was trying for something easier for the user.
The problem with the code was finding an event to fire it in. The only way
around it I found was to create a button which I did not really want to do.

Thanks so much for replying, however!
 
Woops! I spoke too soon. I'm obviously not awake yet.

I need to have the actual text (not the formula "a2") in the P column. This
column will be referred to by a graph and needs the actual name of a person
in it. That actual name is derived from the following formula in Column A.
(This formula was nicely supplied to me by someone in this newsgroup, BTW.)

=IF(ISERROR(INDEX(Sheet2!A:A,MATCH(B2,Sheet2!B:B,0),1)),"",INDEX(Sheet2!A:A,MATCH(B2,Sheet2!B:B,0),1))

Any other suggestions?
 

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

Back
Top