Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Visual Basic - Invisible Command

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Visual Basic - Invisible Command

On May 28, 12:06*pm, Chris Stammers
wrote:
. 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Visual Basic - Invisible Command

Thank you. I'll try that as well.

Regards,
Chris


"andy the pugh" wrote:

On May 28, 12:06 pm, Chris Stammers
wrote:
. 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic - Invisible Command Jacob Skaria Excel Programming 0 May 28th 09 12:13 PM
Visual basic for a rightkey command Zakynthos Excel Programming 10 December 3rd 08 11:40 AM
Help me please understand this Visual Basic command Steve Excel Discussion (Misc queries) 1 September 16th 08 06:14 PM
Is there a command in visual basic to move down one space, e.g. m. Brent Excel Programming 1 September 28th 05 02:04 AM
visual basic command in a cell?? konky Excel Programming 1 August 26th 03 06:33 PM


All times are GMT +1. The time now is 10:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"