Block Copy as opposed to EditCopy

  • Thread starter Thread starter Bruce Roberson
  • Start date Start date
B

Bruce Roberson

In QPW, in macros, most of the time if I didn't want to
take the cursor to a range and do a macro command to edit
copy, then manipulate the cursor back to the new range,
and then do an edit paste. So, I was able to do a macro
equivalent of the menu "block copy" through a macro that
basically allowed me to name a range in the block copy
range without going there, and have it pasted into the
active cell or cells.

Example, I'm in a macro and my cursor is in cell A15. I
know that I want to copy the values of range A100 through
S100 (which we will call a range named "Type2header").

I don't want to move my cursor. I want it to stay in the
active cell which is A15 for the sake of discussion, and I
want to paste the values in the range "Type2header" to
A15..S15. I want an exact overlay basically.

Can I do this in Excel?
 
Hi Bruce,

Me again...

You will find that Select is not needed (most of the time).
Just about any code with Select can be simplified by just doing it straight.
This also makes the code run faster.

Range("A100:S100").Copy _
Destination:=Range("A15")

should do the trick. Notice that only the first cell in the destination
range needs to be identified (this helps when you are not sure but
destination range to specify). And you can use variables and/or named
ranges.

Try something like this:
Range("A3:E3").Formula="=A1+A2"

Or play with formatting, font size, etc.
Remember before you set the print area without selecting the range.

Keep up the good work!

steve
 
Back
Top