Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB select OK from a prompt when running a macro

Hi,

I am writing a VB macro to format a large amount of data in MS Excel
2000.

Part of the macro uses the 'Text to Columns' function, however, when
running the macro the prompt "Do you want to replace the contents of
the destination cells?" appears when the macro gets to the 'Text to
Columns' command in the code.

Is there a way that I can write the macro to always select 'OK' at this
point and keep running.

Thanks in advance, any help is appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default VB select OK from a prompt when running a macro

Simply turn of the user prompts with:
Application.DisplayAlerts = False
and then you code will run on without interuption.

"Stig" wrote in message
oups.com...
Hi,

I am writing a VB macro to format a large amount of data in MS Excel
2000.

Part of the macro uses the 'Text to Columns' function, however, when
running the macro the prompt "Do you want to replace the contents of
the destination cells?" appears when the macro gets to the 'Text to
Columns' command in the code.

Is there a way that I can write the macro to always select 'OK' at this
point and keep running.

Thanks in advance, any help is appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VB select OK from a prompt when running a macro

Try

Application.DisplayAlerts = False
' your code here
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Stig" wrote in message
oups.com...
Hi,

I am writing a VB macro to format a large amount of data in MS
Excel
2000.

Part of the macro uses the 'Text to Columns' function, however,
when
running the macro the prompt "Do you want to replace the
contents of
the destination cells?" appears when the macro gets to the
'Text to
Columns' command in the code.

Is there a way that I can write the macro to always select 'OK'
at this
point and keep running.

Thanks in advance, any help is appreciated.



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
Access denied when running Excel from DOS prompt with runas comman Cam Excel Discussion (Misc queries) 1 April 22nd 10 06:59 PM
Running macro x # of times with a prompt Redskinsfan Excel Worksheet Functions 6 August 8th 06 06:46 PM
How to CANCEL file SAVE PROMPT when MACRO is running? Stuart Macro Muppet Excel Discussion (Misc queries) 3 August 11th 05 12:26 PM
prompt for input while macro running mmcintire Excel Programming 3 January 27th 04 02:57 PM
Can't select another cell after running a macro.... John[_49_] Excel Programming 1 September 23rd 03 10:01 PM


All times are GMT +1. The time now is 11:15 AM.

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"