ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   disabling message (https://www.excelbanter.com/excel-programming/406588-disabling-message.html)

Ariel

disabling message
 
I am writing a macro that loops through the the Excel "Regression Macro"
several times. Because I want the output to replace the existing output (from
the prior loop), I get a message to the effect "Press OK to override existing
data".

How can I disable this message? I tried "Application.DisplayAlerts = False"
but it doesn't work.

Sub TestBSBeta()
'
Dim Time

Time = 0

Do Until Time = 10

Application.Run "ATPVBAEN.XLA!Regress",
ActiveSheet.Range("$H$1:$H$31"), _
ActiveSheet.Range("$J$1:$L$31"), False, True, ,
ActiveSheet.Range("$N$1") _
, False, False, False, False, , False

Application.DisplayAlerts = False


Range("O20").Select
Selection.Copy

Range("O24").Select
ActiveSheet.Paste

Time = Time + 1
Loop

End Sub

JLGWhiz

disabling message
 
Here's one way:


Range("O20").Copy
Range{"O24").ClearContents
Range("O24").Paste





"Ariel" wrote:

I am writing a macro that loops through the the Excel "Regression Macro"
several times. Because I want the output to replace the existing output (from
the prior loop), I get a message to the effect "Press OK to override existing
data".

How can I disable this message? I tried "Application.DisplayAlerts = False"
but it doesn't work.

Sub TestBSBeta()
'
Dim Time

Time = 0

Do Until Time = 10

Application.Run "ATPVBAEN.XLA!Regress",
ActiveSheet.Range("$H$1:$H$31"), _
ActiveSheet.Range("$J$1:$L$31"), False, True, ,
ActiveSheet.Range("$N$1") _
, False, False, False, False, , False

Application.DisplayAlerts = False


Range("O20").Select
Selection.Copy

Range("O24").Select
ActiveSheet.Paste

Time = Time + 1
Loop

End Sub


Ariel

disabling message
 
Excellent! It worked very nicely. Thank you!

"JLGWhiz" wrote:

Here's one way:


Range("O20").Copy
Range{"O24").ClearContents
Range("O24").Paste





"Ariel" wrote:

I am writing a macro that loops through the the Excel "Regression Macro"
several times. Because I want the output to replace the existing output (from
the prior loop), I get a message to the effect "Press OK to override existing
data".

How can I disable this message? I tried "Application.DisplayAlerts = False"
but it doesn't work.

Sub TestBSBeta()
'
Dim Time

Time = 0

Do Until Time = 10

Application.Run "ATPVBAEN.XLA!Regress",
ActiveSheet.Range("$H$1:$H$31"), _
ActiveSheet.Range("$J$1:$L$31"), False, True, ,
ActiveSheet.Range("$N$1") _
, False, False, False, False, , False

Application.DisplayAlerts = False


Range("O20").Select
Selection.Copy

Range("O24").Select
ActiveSheet.Paste

Time = Time + 1
Loop

End Sub



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com