PC Review


Reply
Thread Tools Rate Thread

display alert when workbook open

 
 
=?Utf-8?B?UmFqZXNo?=
Guest
Posts: n/a
 
      27th Dec 2006
Hi,
I've a Excel sheet with customer name and the contract end date.wht i'm
looking for is i want to get a alert message whn open the workbook 1 week
before the contract end date.
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      27th Dec 2006
Private Sub Workbook_Open()
With ThisWorkbook.Worksheets("check").Range("A1")
If .Value >= Date - 7 And .Value <= Date Then
MsgBox "Contract ends on " & Format(.Value, "dd mmm yyyy")
End If
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Rajesh" <(E-Mail Removed)> wrote in message
news:8B307CBA-27B9-4F35-BA82-(E-Mail Removed)...
> Hi,
> I've a Excel sheet with customer name and the contract end date.wht i'm
> looking for is i want to get a alert message whn open the workbook 1 week
> before the contract end date.



 
Reply With Quote
 
=?Utf-8?B?UmFqZXNo?=
Guest
Posts: n/a
 
      28th Dec 2006
Hi Philips,

Thank you verymuch.
but i'm getting an error like-Runtime error 9,Subscript out of range.



"Bob Phillips" wrote:

> Private Sub Workbook_Open()
> With ThisWorkbook.Worksheets("check").Range("A1")
> If .Value >= Date - 7 And .Value <= Date Then
> MsgBox "Contract ends on " & Format(.Value, "dd mmm yyyy")
> End If
> End With
> End Sub
>
> 'This is workbook event code.
> 'To input this code, right click on the Excel icon on the worksheet
> '(or next to the File menu if you maximise your workbooks),
> 'select View Code from the menu, and paste the code
>
>
> --
> ---
> HTH
>
> Bob
>
> (change the xxxx to gmail if mailing direct)
>
>
> "Rajesh" <(E-Mail Removed)> wrote in message
> news:8B307CBA-27B9-4F35-BA82-(E-Mail Removed)...
> > Hi,
> > I've a Excel sheet with customer name and the contract end date.wht i'm
> > looking for is i want to get a alert message whn open the workbook 1 week
> > before the contract end date.

>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      28th Dec 2006
I used a worksheet name of check, you will need to change it to the actual
name.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Rajesh" <(E-Mail Removed)> wrote in message
news:9C098EB6-D649-435F-AE2C-(E-Mail Removed)...
> Hi Philips,
>
> Thank you verymuch.
> but i'm getting an error like-Runtime error 9,Subscript out of range.
>
>
>
> "Bob Phillips" wrote:
>
>> Private Sub Workbook_Open()
>> With ThisWorkbook.Worksheets("check").Range("A1")
>> If .Value >= Date - 7 And .Value <= Date Then
>> MsgBox "Contract ends on " & Format(.Value, "dd mmm yyyy")
>> End If
>> End With
>> End Sub
>>
>> 'This is workbook event code.
>> 'To input this code, right click on the Excel icon on the worksheet
>> '(or next to the File menu if you maximise your workbooks),
>> 'select View Code from the menu, and paste the code
>>
>>
>> --
>> ---
>> HTH
>>
>> Bob
>>
>> (change the xxxx to gmail if mailing direct)
>>
>>
>> "Rajesh" <(E-Mail Removed)> wrote in message
>> news:8B307CBA-27B9-4F35-BA82-(E-Mail Removed)...
>> > Hi,
>> > I've a Excel sheet with customer name and the contract end date.wht i'm
>> > looking for is i want to get a alert message whn open the workbook 1
>> > week
>> > before the contract end date.

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?UmFqZXNo?=
Guest
Posts: n/a
 
      28th Dec 2006
Thanks Bob,

i got that, Thank you verymuch.
and one more issue, hw do i select the entire column,here its only for
A1,when i tried like A1:A100,this giving some error 13, type mismatch.

"Bob Phillips" wrote:

> I used a worksheet name of check, you will need to change it to the actual
> name.
>
> --
> ---
> HTH
>
> Bob
>
> (change the xxxx to gmail if mailing direct)
>
>
> "Rajesh" <(E-Mail Removed)> wrote in message
> news:9C098EB6-D649-435F-AE2C-(E-Mail Removed)...
> > Hi Philips,
> >
> > Thank you verymuch.
> > but i'm getting an error like-Runtime error 9,Subscript out of range.
> >
> >
> >
> > "Bob Phillips" wrote:
> >
> >> Private Sub Workbook_Open()
> >> With ThisWorkbook.Worksheets("check").Range("A1")
> >> If .Value >= Date - 7 And .Value <= Date Then
> >> MsgBox "Contract ends on " & Format(.Value, "dd mmm yyyy")
> >> End If
> >> End With
> >> End Sub
> >>
> >> 'This is workbook event code.
> >> 'To input this code, right click on the Excel icon on the worksheet
> >> '(or next to the File menu if you maximise your workbooks),
> >> 'select View Code from the menu, and paste the code
> >>
> >>
> >> --
> >> ---
> >> HTH
> >>
> >> Bob
> >>
> >> (change the xxxx to gmail if mailing direct)
> >>
> >>
> >> "Rajesh" <(E-Mail Removed)> wrote in message
> >> news:8B307CBA-27B9-4F35-BA82-(E-Mail Removed)...
> >> > Hi,
> >> > I've a Excel sheet with customer name and the contract end date.wht i'm
> >> > looking for is i want to get a alert message whn open the workbook 1
> >> > week
> >> > before the contract end date.
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      28th Dec 2006
Private Sub Workbook_Open()
Dim sMsg As String
Dim cell As range

With ThisWorkbook.Worksheets("check")
For Each cell In .Range("A1:A100")
If cell.Value >= Date - 7 And cell.Value <= Date Then
sMsg = sMsg & "Contract in " & cell.Address(False, False) &
_
" ends on " & Format(cell.Value, "dd mmm
yyyy") & vbNewLine
End If
Next cell
End With

If sMsg <> "" Then MsgBox sMsg

End Sub


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Rajesh" <(E-Mail Removed)> wrote in message
news:20E47E45-1450-43FE-A7CE-(E-Mail Removed)...
> Thanks Bob,
>
> i got that, Thank you verymuch.
> and one more issue, hw do i select the entire column,here its only for
> A1,when i tried like A1:A100,this giving some error 13, type mismatch.
>
> "Bob Phillips" wrote:
>
>> I used a worksheet name of check, you will need to change it to the
>> actual
>> name.
>>
>> --
>> ---
>> HTH
>>
>> Bob
>>
>> (change the xxxx to gmail if mailing direct)
>>
>>
>> "Rajesh" <(E-Mail Removed)> wrote in message
>> news:9C098EB6-D649-435F-AE2C-(E-Mail Removed)...
>> > Hi Philips,
>> >
>> > Thank you verymuch.
>> > but i'm getting an error like-Runtime error 9,Subscript out of range.
>> >
>> >
>> >
>> > "Bob Phillips" wrote:
>> >
>> >> Private Sub Workbook_Open()
>> >> With ThisWorkbook.Worksheets("check").Range("A1")
>> >> If .Value >= Date - 7 And .Value <= Date Then
>> >> MsgBox "Contract ends on " & Format(.Value, "dd mmm yyyy")
>> >> End If
>> >> End With
>> >> End Sub
>> >>
>> >> 'This is workbook event code.
>> >> 'To input this code, right click on the Excel icon on the worksheet
>> >> '(or next to the File menu if you maximise your workbooks),
>> >> 'select View Code from the menu, and paste the code
>> >>
>> >>
>> >> --
>> >> ---
>> >> HTH
>> >>
>> >> Bob
>> >>
>> >> (change the xxxx to gmail if mailing direct)
>> >>
>> >>
>> >> "Rajesh" <(E-Mail Removed)> wrote in message
>> >> news:8B307CBA-27B9-4F35-BA82-(E-Mail Removed)...
>> >> > Hi,
>> >> > I've a Excel sheet with customer name and the contract end date.wht
>> >> > i'm
>> >> > looking for is i want to get a alert message whn open the workbook 1
>> >> > week
>> >> > before the contract end date.
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to display message,when open workbook puiuluipui Microsoft Excel Misc 7 13th Oct 2009 12:39 PM
Open a specific workbook...find value from other open workbook and then insert cells values in cell next to it. amorrison2006@googlemail.com Microsoft Excel Programming 1 13th May 2007 01:46 PM
open workbook, display certain sheets jerryasmith@gmail.com Microsoft Excel Programming 1 9th Mar 2007 07:08 AM
workbook protection alert =?Utf-8?B?UGF0aW8=?= Microsoft Excel Misc 1 28th Sep 2006 09:44 PM
How do I add an alert message upon a user closing the workbook? =?Utf-8?B?ZWhvc2tpbnM=?= Microsoft Excel Misc 1 12th Jul 2006 10:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:05 PM.