macro - copy values only

  • Thread starter Thread starter JQ
  • Start date Start date
J

JQ

When I say x = Range("a1") I am copy all formatting as
well as the value in the cell. Is there a way to assign a
variable to the value in the cell only?
I want to be able to search a column and if certain
conditions are true I want to say something like
Range("X2") = x

Thanks
 
if use VBA,

Dim x as Variant
x = Range("A1").Value
Range("X2").Value = x

is just the value in the cell

if you did

Dim x as Range
set x = Range("A1")

then you have created a reference to the cell and you can deal with
formatting and so forth. even in this second instance you can do

Range("X2").Value = x.Value
 

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