I write a macro, there will some data copy from a sheet1 to another sheet2,
and then , the sheet1 will be closed. while the macro is running, there is a
message to ask me some data in clipboard, will I use it. I will choose "NO"
manually everytime when the macro running.
How can I write something in macro to skip this message to let the macro
non-stop finish.
Mike H - 25 May 2008 10:19 GMT
Hi,
You can clear the clipboard with
Application.CutCopyMode=False
or you can use
Application.DisplayAlerts=False
'You code to close workbook
Application.DisplayAlerts=True
Either of which should suppress that message
Mike
> I write a macro, there will some data copy from a sheet1 to another sheet2,
> and then , the sheet1 will be closed. while the macro is running, there is a
> message to ask me some data in clipboard, will I use it. I will choose "NO"
> manually everytime when the macro running.
> How can I write something in macro to skip this message to let the macro
> non-stop finish.
Gord Dibben - 25 May 2008 17:43 GMT
Sub macroname()
your code to copy and paste
Application.CutCopyMode = False 'clears the clipboard
continue with your code.
End Sub
Gord Dibben MS Excel MVP
>I write a macro, there will some data copy from a sheet1 to another sheet2,
>and then , the sheet1 will be closed. while the macro is running, there is a
>message to ask me some data in clipboard, will I use it. I will choose "NO"
>manually everytime when the macro running.
>How can I write something in macro to skip this message to let the macro
>non-stop finish.