optimized way for copying formats and values

  • Thread starter Thread starter jerm
  • Start date Start date
J

jerm

Hi,
I am trying to copy the formats and values from one sheet to another.
I want to get around using the copy paste method so i am trying
something like this:

Sheets("1").Range("A1:AA160") = Sheets("2").Range("A1:AA160").Values

Ok, that works fine and dandy... but what if the range is dynamic!

I want something like this
Sheets("1").UsedRange = Sheets("2").UsedRange.Values

but vba doesnt like that

I also want to do the same thing for the formats like this
Sheets("1").UsedRange.FormatConditions =
Sheets("2").UsedRange.FormatConditions

No dice either...

Could anyone steer me in the right direction.
thanks
jer
 
The values are fairly straight forward. Something like this...

With Sheets("2")
Sheets("1").Range(.UsedRange.Address).Value = .UsedRange.Value
End With

The formats however need to be copied and pasted so the above code doesn't
do you a lot of good.
 

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