Visual Basic - Invisible Command

C

Chris Stammers

Hello,

I have some macros written in VB Script that opens 2 different workbooks,
selects cells from one and pastes/special/values to the other. There are
multiple tabs in the destination files. There are 4 different macros in the
project with each set to call the next one. The script works fine however you
can see it flicking between each sheet as it is copying and pasting. Is there
a piece of code that will hide this? I am using Excel 2003.

Many thanks.
Chris
 
A

andy the pugh

. The script works fine however you
can see it flicking between each sheet as it is copying and pasting. Is there
a piece of code that will hide this? I am using Excel 2003.

You can hide it with application.screenupdating as suggested above.
However, it sounds like your macros are perhaps based on recorded
macros? Recorded macros always select cells then work on them, which
is inelegant and potentially problematical. Much better to refer to
cells and ranges directly.

eg, instead of
Sheet1.range("A2:B3").select
selection.copy

use

sheet1.range("A2:B3").Copy
 

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