Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default macro with input msg based on cell contents

I have previously posted this question and have not received a response to
date - please can someone help me....:)
I need help to run a macro with input msg when a date is entered into the
cell eg. date is input to cell M20 - input message "Budget received - do you
want to complete Budget Calculator" If "Yes" is selected then worksheet
"Budget Calc" is copied and renamed based on contents of cell A2 (I think I
have the renaming sorted thanks to previous posts). If "No" selected then
macro stops.
Any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default macro with input msg based on cell contents

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "M20" '<== change to suit
Const msg As String = "Budget received - complete the Budget Calculator"

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target

If MsgBox(msg, vbYesNo) = vbYes Then

Worksheets("Budget Calc").Copy _
after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Me.Range("A2").Value
Me.Activate
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Janelle S" wrote in message
...
I have previously posted this question and have not received a response to
date - please can someone help me....:)
I need help to run a macro with input msg when a date is entered into the
cell eg. date is input to cell M20 - input message "Budget received - do
you
want to complete Budget Calculator" If "Yes" is selected then worksheet
"Budget Calc" is copied and renamed based on contents of cell A2 (I think
I
have the renaming sorted thanks to previous posts). If "No" selected then
macro stops.
Any help would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default macro with input msg based on cell contents

Thank you so much, Bob. This has worked perfectly - I really appreciate you
taking the time to look at this. Communities is the best thing ever.

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "M20" '<== change to suit
Const msg As String = "Budget received - complete the Budget Calculator"

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target

If MsgBox(msg, vbYesNo) = vbYes Then

Worksheets("Budget Calc").Copy _
after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Me.Range("A2").Value
Me.Activate
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Janelle S" wrote in message
...
I have previously posted this question and have not received a response to
date - please can someone help me....:)
I need help to run a macro with input msg when a date is entered into the
cell eg. date is input to cell M20 - input message "Budget received - do
you
want to complete Budget Calculator" If "Yes" is selected then worksheet
"Budget Calc" is copied and renamed based on contents of cell A2 (I think
I
have the renaming sorted thanks to previous posts). If "No" selected then
macro stops.
Any help would be appreciated.




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
run macro with input msg based on cell input Janelle S Excel Discussion (Misc queries) 0 January 20th 08 05:23 AM
Formatting one cell based on the contents of another [email protected] Excel Discussion (Misc queries) 4 April 13th 07 06:15 PM
Delete cell contents with input to adjacent cell Ashley Frank Excel Discussion (Misc queries) 1 October 5th 05 04:28 PM
How do I change the format of a cell based on what I input? Husker87 Excel Worksheet Functions 8 August 19th 05 10:45 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM


All times are GMT +1. The time now is 01:12 PM.

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"