Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default "Do you want to replace the contents of the destination cells?"

I have an AUTO_OPEN macro...

Sometimes, I get the Message Above w/ Yes and No Buttons.

Why does this occur...can I turn it off?

TIA - Bob
  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: "Do you want to replace the contents of the destination cells?"

Hi Bob,

The message you are seeing is a warning message that Excel displays when you are copying data from one cell to another and the destination cell already contains data. The message is asking if you want to replace the existing data with the new data.

The reason you are seeing this message is because your macro is copying data to a cell that already contains data. If you want to turn off this warning message, you can add the following line of code to your macro before the copy command:

Code:
Application.DisplayAlerts = False
This will turn off all warning messages in Excel, including the one you are seeing. However, be careful when using this command, as it can suppress other important warning messages as well.

If you want to avoid overwriting existing data, you can modify your macro to check if the destination cell is empty before copying data to it. You can do this by using an IF statement in your macro.

Here are the steps to modify your macro:
  1. Find the line in your macro that copies data to the destination cell.
  2. Add an IF statement before the copy command to check if the destination cell is empty. The IF statement should look like this:

    Code:
    If Range("destination_cell").Value = "" Then
    Replace "destination_cell" with the cell reference of the destination cell.
  3. Add an END IF statement after the copy command to close the IF statement. The END IF statement should look like this:

    Code:
    End If

After your macro has finished running, you should turn the warning messages back on by adding the following line of code:

Code:
Application.DisplayAlerts = True
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default "Do you want to replace the contents of the destination cells?"

Your Auto_Open code is obviously trying to paste something into filled cells or
similar operation like Text to Columns.

You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Check your code to see what it is doing before adding more code to turn off the
message.


Gord Dibben MS Excel MVP


On Mon, 15 Jan 2007 11:02:01 -0800, Bob Barnes
wrote:

I have an AUTO_OPEN macro...

Sometimes, I get the Message Above w/ Yes and No Buttons.

Why does this occur...can I turn it off?

TIA - Bob


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default "Do you want to replace the contents of the destination cells?

Gord - Thank you.

I'm not sure what is causing...
Your Auto_Open code is obviously trying to paste something into filled cells
or
similar operation like Text to Columns.

Your..
You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Bob -- Yes, I'd like to turnoff the MsgBox and default to Yes replacing
destination cells...How do I do that? Everything is being populated via
automation from Access...and is doing what is needed.

TIA - Bob

"Gord Dibben" wrote:

Your Auto_Open code is obviously trying to paste something into filled cells or
similar operation like Text to Columns.

You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Check your code to see what it is doing before adding more code to turn off the
message.


Gord Dibben MS Excel MVP


On Mon, 15 Jan 2007 11:02:01 -0800, Bob Barnes
wrote:

I have an AUTO_OPEN macro...

Sometimes, I get the Message Above w/ Yes and No Buttons.

Why does this occur...can I turn it off?

TIA - Bob



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default "Do you want to replace the contents of the destination cells?

Sometimes, this'll work:

Application.displayalerts = false
'your code that causes the alert to appear
application.displayalerts = true



Bob Barnes wrote:

Gord - Thank you.

I'm not sure what is causing...
Your Auto_Open code is obviously trying to paste something into filled cells
or
similar operation like Text to Columns.

Your..
You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Bob -- Yes, I'd like to turnoff the MsgBox and default to Yes replacing
destination cells...How do I do that? Everything is being populated via
automation from Access...and is doing what is needed.

TIA - Bob

"Gord Dibben" wrote:

Your Auto_Open code is obviously trying to paste something into filled cells or
similar operation like Text to Columns.

You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Check your code to see what it is doing before adding more code to turn off the
message.


Gord Dibben MS Excel MVP


On Mon, 15 Jan 2007 11:02:01 -0800, Bob Barnes
wrote:

I have an AUTO_OPEN macro...

Sometimes, I get the Message Above w/ Yes and No Buttons.

Why does this occur...can I turn it off?

TIA - Bob




--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default "Do you want to replace the contents of the destination cells?

That works..Thank you.

Only question. Since the Focus is set to "Yes"...that should answer as "Yes".

Thanks again - Bob

"Dave Peterson" wrote:

Sometimes, this'll work:

Application.displayalerts = false
'your code that causes the alert to appear
application.displayalerts = true



Bob Barnes wrote:

Gord - Thank you.

I'm not sure what is causing...
Your Auto_Open code is obviously trying to paste something into filled cells
or
similar operation like Text to Columns.

Your..
You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Bob -- Yes, I'd like to turnoff the MsgBox and default to Yes replacing
destination cells...How do I do that? Everything is being populated via
automation from Access...and is doing what is needed.

TIA - Bob

"Gord Dibben" wrote:

Your Auto_Open code is obviously trying to paste something into filled cells or
similar operation like Text to Columns.

You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Check your code to see what it is doing before adding more code to turn off the
message.


Gord Dibben MS Excel MVP


On Mon, 15 Jan 2007 11:02:01 -0800, Bob Barnes
wrote:

I have an AUTO_OPEN macro...

Sometimes, I get the Message Above w/ Yes and No Buttons.

Why does this occur...can I turn it off?

TIA - Bob



--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default "Do you want to replace the contents of the destination cells?

Nope.

This doesn't even see the warning box--it just assumes that you don't want to be
bothered by the warning and that you know what you're doing.

Bob Barnes wrote:

That works..Thank you.

Only question. Since the Focus is set to "Yes"...that should answer as "Yes".

Thanks again - Bob

"Dave Peterson" wrote:

Sometimes, this'll work:

Application.displayalerts = false
'your code that causes the alert to appear
application.displayalerts = true



Bob Barnes wrote:

Gord - Thank you.

I'm not sure what is causing...
Your Auto_Open code is obviously trying to paste something into filled cells
or
similar operation like Text to Columns.

Your..
You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Bob -- Yes, I'd like to turnoff the MsgBox and default to Yes replacing
destination cells...How do I do that? Everything is being populated via
automation from Access...and is doing what is needed.

TIA - Bob

"Gord Dibben" wrote:

Your Auto_Open code is obviously trying to paste something into filled cells or
similar operation like Text to Columns.

You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Check your code to see what it is doing before adding more code to turn off the
message.


Gord Dibben MS Excel MVP


On Mon, 15 Jan 2007 11:02:01 -0800, Bob Barnes
wrote:

I have an AUTO_OPEN macro...

Sometimes, I get the Message Above w/ Yes and No Buttons.

Why does this occur...can I turn it off?

TIA - Bob



--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default "Do you want to replace the contents of the destination cells?

Dave - Not sure why the "warning" appears, but the data I need
is there from the automation code in Access.

Thanks again - Bob

"Dave Peterson" wrote:

Nope.

This doesn't even see the warning box--it just assumes that you don't want to be
bothered by the warning and that you know what you're doing.

Bob Barnes wrote:

That works..Thank you.

Only question. Since the Focus is set to "Yes"...that should answer as "Yes".

Thanks again - Bob

"Dave Peterson" wrote:

Sometimes, this'll work:

Application.displayalerts = false
'your code that causes the alert to appear
application.displayalerts = true



Bob Barnes wrote:

Gord - Thank you.

I'm not sure what is causing...
Your Auto_Open code is obviously trying to paste something into filled cells
or
similar operation like Text to Columns.

Your..
You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Bob -- Yes, I'd like to turnoff the MsgBox and default to Yes replacing
destination cells...How do I do that? Everything is being populated via
automation from Access...and is doing what is needed.

TIA - Bob

"Gord Dibben" wrote:

Your Auto_Open code is obviously trying to paste something into filled cells or
similar operation like Text to Columns.

You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Check your code to see what it is doing before adding more code to turn off the
message.


Gord Dibben MS Excel MVP


On Mon, 15 Jan 2007 11:02:01 -0800, Bob Barnes
wrote:

I have an AUTO_OPEN macro...

Sometimes, I get the Message Above w/ Yes and No Buttons.

Why does this occur...can I turn it off?

TIA - Bob



--

Dave Peterson


--

Dave Peterson

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default "Do you want to replace the contents of the destination cells?

I don't understand.

You said it works, but now it sounds like you still see the message.

Bob Barnes wrote:

Dave - Not sure why the "warning" appears, but the data I need
is there from the automation code in Access.

Thanks again - Bob

"Dave Peterson" wrote:

Nope.

This doesn't even see the warning box--it just assumes that you don't want to be
bothered by the warning and that you know what you're doing.

Bob Barnes wrote:

That works..Thank you.

Only question. Since the Focus is set to "Yes"...that should answer as "Yes".

Thanks again - Bob

"Dave Peterson" wrote:

Sometimes, this'll work:

Application.displayalerts = false
'your code that causes the alert to appear
application.displayalerts = true



Bob Barnes wrote:

Gord - Thank you.

I'm not sure what is causing...
Your Auto_Open code is obviously trying to paste something into filled cells
or
similar operation like Text to Columns.

Your..
You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Bob -- Yes, I'd like to turnoff the MsgBox and default to Yes replacing
destination cells...How do I do that? Everything is being populated via
automation from Access...and is doing what is needed.

TIA - Bob

"Gord Dibben" wrote:

Your Auto_Open code is obviously trying to paste something into filled cells or
similar operation like Text to Columns.

You can turn off the message and have it default to "Yes" but are you sure you
want the destination cells to be replaced?

Check your code to see what it is doing before adding more code to turn off the
message.


Gord Dibben MS Excel MVP


On Mon, 15 Jan 2007 11:02:01 -0800, Bob Barnes
wrote:

I have an AUTO_OPEN macro...

Sometimes, I get the Message Above w/ Yes and No Buttons.

Why does this occur...can I turn it off?

TIA - Bob



--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Why does not Excel 2003 Replace comand romove spaces from cell contents? Dmitry Excel Worksheet Functions 5 April 6th 06 04:26 PM
use replace command to change the contents of formulas Jordan Excel Discussion (Misc queries) 3 June 27th 05 04:51 PM
Find and Replace Hyperlink Contents Dede Excel Discussion (Misc queries) 11 April 29th 05 12:29 AM
replace cell contents Nancy B Excel Worksheet Functions 2 March 16th 05 04:39 PM
How do I replace the contents of a cell with its value instead of. Jean Excel Worksheet Functions 1 March 3rd 05 08:53 PM


All times are GMT +1. The time now is 04:59 PM.

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

About Us

"It's about Microsoft Excel"