Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Interupt code with message before it runs

I want to include the option to accept or cancel an action before the code
runs.

Private Sub Filldown_formula_Click()
Range("C10").Select
Selection.AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
Range("C10:C7800").Select
End sub


By including this msgBox which includes a €œYes€ or €œNo€ command buttons.

MsgBox "This will reset the formula, do you wish to proceed"

Thank you if you can help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Interupt code with message before it runs

Try the below

Private Sub Filldown_formula_Click()

If MsgBox("This will reset the formula, do you wish to proceed", _
vbYesNo + vbDefaultButton2) = vbYes Then
Range("C10").AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
End If

End Sub


--
Jacob


"Gotroots" wrote:

I want to include the option to accept or cancel an action before the code
runs.

Private Sub Filldown_formula_Click()
Range("C10").Select
Selection.AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
Range("C10:C7800").Select
End sub


By including this msgBox which includes a €œYes€ or €œNo€ command buttons.

MsgBox "This will reset the formula, do you wish to proceed"

Thank you if you can help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Interupt code with message before it runs

The code still ran even though the "No" option was selected.

"Jacob Skaria" wrote:

Try the below

Private Sub Filldown_formula_Click()

If MsgBox("This will reset the formula, do you wish to proceed", _
vbYesNo + vbDefaultButton2) = vbYes Then
Range("C10").AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
End If

End Sub


--
Jacob


"Gotroots" wrote:

I want to include the option to accept or cancel an action before the code
runs.

Private Sub Filldown_formula_Click()
Range("C10").Select
Selection.AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
Range("C10:C7800").Select
End sub


By including this msgBox which includes a €œYes€ or €œNo€ command buttons.

MsgBox "This will reset the formula, do you wish to proceed"

Thank you if you can help.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Interupt code with message before it runs

Copy paste the code and try

If MsgBox("This will reset the formula, do you wish to proceed", _
vbYesNo + vbDefaultButton2) = vbYes Then
Range("C10").AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
End If

--
Jacob


"Gotroots" wrote:

The code still ran even though the "No" option was selected.

"Jacob Skaria" wrote:

Try the below

Private Sub Filldown_formula_Click()

If MsgBox("This will reset the formula, do you wish to proceed", _
vbYesNo + vbDefaultButton2) = vbYes Then
Range("C10").AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
End If

End Sub


--
Jacob


"Gotroots" wrote:

I want to include the option to accept or cancel an action before the code
runs.

Private Sub Filldown_formula_Click()
Range("C10").Select
Selection.AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
Range("C10:C7800").Select
End sub


By including this msgBox which includes a €œYes€ or €œNo€ command buttons.

MsgBox "This will reset the formula, do you wish to proceed"

Thank you if you can help.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Interupt code with message before it runs

I made a typo error. Sorry for the false alarm.

"Jacob Skaria" wrote:

Copy paste the code and try

If MsgBox("This will reset the formula, do you wish to proceed", _
vbYesNo + vbDefaultButton2) = vbYes Then
Range("C10").AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
End If

--
Jacob


"Gotroots" wrote:

The code still ran even though the "No" option was selected.

"Jacob Skaria" wrote:

Try the below

Private Sub Filldown_formula_Click()

If MsgBox("This will reset the formula, do you wish to proceed", _
vbYesNo + vbDefaultButton2) = vbYes Then
Range("C10").AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
End If

End Sub


--
Jacob


"Gotroots" wrote:

I want to include the option to accept or cancel an action before the code
runs.

Private Sub Filldown_formula_Click()
Range("C10").Select
Selection.AutoFill Destination:=Range("C10:C7800"), Type:=xlFillDefault
Range("C10:C7800").Select
End sub


By including this msgBox which includes a €œYes€ or €œNo€ command buttons.

MsgBox "This will reset the formula, do you wish to proceed"

Thank you if you can help.

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
macro runs fine but error message is displayed already Excel Programming 4 November 11th 08 07:26 PM
Warning message while macro runs Greg H.[_3_] Excel Programming 6 May 8th 08 12:06 AM
Interupt processing Dave597 Excel Discussion (Misc queries) 0 April 18th 08 08:07 PM
Display a message whilst a macro runs steve Excel Programming 0 October 29th 03 07:37 PM
Display a message whilst a macro runs Tom Ogilvy Excel Programming 0 October 29th 03 12:43 PM


All times are GMT +1. The time now is 09:21 AM.

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"