Disable Overwriting message

monhuhu

New Member
Joined
Dec 4, 2019
Messages
5
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I wrote my code to generate random numbers and every time there is a alert message say "Press Ok to overwrite data". How to turn this off? I tried

With Application

.DisplayAlerts = False
.ScreenUpdating = False
.AlertBeforeOverwriting = False

End

or

Application.DisplayAlerts = False

BUT it didnt work.



MY code is

Range("A13").Select

Application.Run "ATPVBAEN.XLAM!Random", ActiveSheet.Range("$A$13"), 1, 210 _
, 7, , ActiveSheet.Range("$B$6:$C$8")

Range("B13").Select

Application.Run "ATPVBAEN.XLAM!Random", ActiveSheet.Range("$B$13"), 1, 210 _
, 7, , ActiveSheet.Range("$B$2:$C$3")

Range("C13").Select

Application.Run "ATPVBAEN.XLAM!Random", ActiveSheet.Range("$C$13"), 1, 210 _
, 7, , ActiveSheet.Range("$B$2:$C$3")





End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I am guessing that the Random function you are using is generating this warning. Excel does not give any such warning. I would suggest explicitly deleting data in your destinations first to see if that fixes it.

If I am reading your function call right, you are generating 210 values each time:

ActiveSheet.Range("A13:C223").Clear

Also,two things:
When posting code please use code tags (highlight your code then click the </> symbol in the edit controls)
There is no need for the Select statements in your code.
 
Upvote 0
I'd also have a look in the sheet modules for other code that may be firing when a selection / s gets changed and returning the message.
 
Upvote 0
It works!! Thank you
I am guessing that the Random function you are using is generating this warning. Excel does not give any such warning. I would suggest explicitly deleting data in your destinations first to see if that fixes it.

If I am reading your function call right, you are generating 210 values each time:

ActiveSheet.Range("A13:C223").Clear

Also,two things:
When posting code please use code tags (highlight your code then click the </> symbol in the edit controls)
There is no need for the Select statements in your code.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top