Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default programming VBA


I have a worksheet made up for different cost centers
with reference to invoices. For example who they are
from, what date is on the invoice, what date did we
receive them, amount, etc. I have written the following
module and formula (see below for details) in order to
bring up a message box if the amount of days between two
dates are greater than 15. The reason for this is that we
have a turnaround time of 14 days to pay these invoices
and staff forget to issue a late letter if the invoice is
paid outside the 15 days.
This works great, the message box appears when the days
are greater than 15 days, the only problem is when you
run auto filter the message box will appear again before
searching under filter.
I originally had conditional formatting in the cells but
staff either forgot or just didn't think to issue a late
letter invoice
Can I add something to the module (see below) to say
delete the formula in that cell once the ok button has
been hit or activated? This would I think fix the problem

Module
Option Explicit

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter and input
relevant information to PP spreadsheet"

End Function

Formula in Cells
=IF((F4-E4)=15,PromptPayment()+F4-E4,F4-E4)
Thanks

Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default programming VBA

No, a function can return a result (and give a MsgBox as you found), but it
cannot modify the contents of the cell, or any other cells.

--
HTH

Bob Phillips

"Mark" wrote in message
...

I have a worksheet made up for different cost centers
with reference to invoices. For example who they are
from, what date is on the invoice, what date did we
receive them, amount, etc. I have written the following
module and formula (see below for details) in order to
bring up a message box if the amount of days between two
dates are greater than 15. The reason for this is that we
have a turnaround time of 14 days to pay these invoices
and staff forget to issue a late letter if the invoice is
paid outside the 15 days.
This works great, the message box appears when the days
are greater than 15 days, the only problem is when you
run auto filter the message box will appear again before
searching under filter.
I originally had conditional formatting in the cells but
staff either forgot or just didn't think to issue a late
letter invoice
Can I add something to the module (see below) to say
delete the formula in that cell once the ok button has
been hit or activated? This would I think fix the problem

Module
Option Explicit

Public Function PromptPayment()
MsgBox "Please issue Prompt Payment Letter and input
relevant information to PP spreadsheet"

End Function

Formula in Cells
=IF((F4-E4)=15,PromptPayment()+F4-E4,F4-E4)
Thanks

Mark



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
programming ernie Excel Discussion (Misc queries) 4 March 13th 06 02:06 PM
Please help with programming RandyJ Excel Programming 2 October 8th 04 10:59 PM
Programming in VB Kamyk Excel Programming 2 July 8th 04 11:02 PM
vba programming sal Excel Programming 1 October 27th 03 07:44 PM
Do I need programming for this? .NET Developer Excel Programming 2 August 18th 03 08:55 PM


All times are GMT +1. The time now is 07:11 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"