Range variables

C

carl

I'm trying to copy and paste data from one sheet to another and thought it
would be useful to group a range rather than each cell and then paste. Am I
able to create variables for ranges? I don't seem to be able to make it
work. The code I've got is:

Dim Cases as Range

Cases = Range("B25,B27,B29,B30,B31").Value

Range("B5").Select
ActiveCell.Value = Cases

That's with a few things cut out but you get the picture. Anyway, the macro
is giving a 91 bug and stopping as the Cases = Range part.

Any ideas would be very helpful.
 
T

Tom Ogilvy

No, you can't do anything like that. You could do

Range("B25,B27,B29:B31").copy Range("B5")
 

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