Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My Excel macro at several points performs some cut'n'pasting, and the dialog
box appears : "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" I want the macro to accept a "Yes" programatically and carry on working. I'm sure there's an easy answer but I haven't found it. Can anyone help? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This produces a message box with your question in it. If the user clicks Yes
then the code continues as currently written. If the user clicks No then code that you have yet to compose will execute to change the name of whatever it is the user is working with and then continue with currently written code. Msg = "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" doWhat = MsgBox(Msg, vbYesNo + vbQuestion, "MAKE A CHOICE") If doWhat = vbYes Then 'Do nothing Else 'Code to change name End If "Sian" wrote: My Excel macro at several points performs some cut'n'pasting, and the dialog box appears : "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" I want the macro to accept a "Yes" programatically and carry on working. I'm sure there's an easy answer but I haven't found it. Can anyone help? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I see I didn't explain myself very well (well, it is Friday pm!!). I don't
want the dialog box to appear at all - at the moment the user has to sit there clicking "Yes" 20 times "JLGWhiz" wrote: This produces a message box with your question in it. If the user clicks Yes then the code continues as currently written. If the user clicks No then code that you have yet to compose will execute to change the name of whatever it is the user is working with and then continue with currently written code. Msg = "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" doWhat = MsgBox(Msg, vbYesNo + vbQuestion, "MAKE A CHOICE") If doWhat = vbYes Then 'Do nothing Else 'Code to change name End If "Sian" wrote: My Excel macro at several points performs some cut'n'pasting, and the dialog box appears : "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" I want the macro to accept a "Yes" programatically and carry on working. I'm sure there's an easy answer but I haven't found it. Can anyone help? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am not sure you can use:
Application.DisplayAlerts = False Then, at a point when the cut and paste is finished: Application.DisplayAlerts = True It is difficult to analyze without the code being posted. "Sian" wrote: I see I didn't explain myself very well (well, it is Friday pm!!). I don't want the dialog box to appear at all - at the moment the user has to sit there clicking "Yes" 20 times "JLGWhiz" wrote: This produces a message box with your question in it. If the user clicks Yes then the code continues as currently written. If the user clicks No then code that you have yet to compose will execute to change the name of whatever it is the user is working with and then continue with currently written code. Msg = "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" doWhat = MsgBox(Msg, vbYesNo + vbQuestion, "MAKE A CHOICE") If doWhat = vbYes Then 'Do nothing Else 'Code to change name End If "Sian" wrote: My Excel macro at several points performs some cut'n'pasting, and the dialog box appears : "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" I want the macro to accept a "Yes" programatically and carry on working. I'm sure there's an easy answer but I haven't found it. Can anyone help? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked - thank you!
"JLGWhiz" wrote: I am not sure you can use: Application.DisplayAlerts = False Then, at a point when the cut and paste is finished: Application.DisplayAlerts = True It is difficult to analyze without the code being posted. "Sian" wrote: I see I didn't explain myself very well (well, it is Friday pm!!). I don't want the dialog box to appear at all - at the moment the user has to sit there clicking "Yes" 20 times "JLGWhiz" wrote: This produces a message box with your question in it. If the user clicks Yes then the code continues as currently written. If the user clicks No then code that you have yet to compose will execute to change the name of whatever it is the user is working with and then continue with currently written code. Msg = "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" doWhat = MsgBox(Msg, vbYesNo + vbQuestion, "MAKE A CHOICE") If doWhat = vbYes Then 'Do nothing Else 'Code to change name End If "Sian" wrote: My Excel macro at several points performs some cut'n'pasting, and the dialog box appears : "A formula or sheet you want to move or copy contains the name 'Parnerlist' which already exists on the destination worksheet. Do you want to use this version of the name?" I want the macro to accept a "Yes" programatically and carry on working. I'm sure there's an easy answer but I haven't found it. Can anyone help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dialog Boxes | Excel Discussion (Misc queries) | |||
suppressing auto-dailog boxes | Excel Programming | |||
Dialog Boxes | Excel Discussion (Misc queries) | |||
Dialog boxes | Excel Discussion (Misc queries) | |||
Suppressing or turning off the Printing dialog | Excel Programming |