Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark Jackson
 
Posts: n/a
Default Insert Criteria Based on Current Month

Hello,

I have a worksheet that lists all awards won since January 1, 2006. Each
month I have to send a report that shows the wins for that month. I put a
"N" next to the award date to denote "new this month". Is there any way to
automatically do this when I put in the date of the award and it is the
current month? Thanks for your help.

Mark
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Insert Criteria Based on Current Month

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error GoTo ws_exit
Application.EnableEvents = False
If Target.Column = 5 Then
If Month(Target.Value) = Month(Date) Then
Target.Offset(0, 1) = "N"
End If
End If

ws_exit:
Application.EnableEvents = True
On Error GoTo 0

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 Phillips

(remove nothere from the email address if mailing direct)

"Mark Jackson" wrote in message
...
Hello,

I have a worksheet that lists all awards won since January 1, 2006. Each
month I have to send a report that shows the wins for that month. I put a
"N" next to the award date to denote "new this month". Is there any way

to
automatically do this when I put in the date of the award and it is the
current month? Thanks for your help.

Mark



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark Jackson
 
Posts: n/a
Default Insert Criteria Based on Current Month

Bob,

I copied and paste the event code into the worksheet and now I get an error
when I open the workbook. This is the error: Microsoft Excel cannot calulate
a formula. Cell references in the formula's result, creating a circular
reference. Is there anyway to delete this or modify so it will work? Any
help is appreciated.

Sincerely,

Mark

"Bob Phillips" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error GoTo ws_exit
Application.EnableEvents = False
If Target.Column = 5 Then
If Month(Target.Value) = Month(Date) Then
Target.Offset(0, 1) = "N"
End If
End If

ws_exit:
Application.EnableEvents = True
On Error GoTo 0

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 Phillips

(remove nothere from the email address if mailing direct)

"Mark Jackson" wrote in message
...
Hello,

I have a worksheet that lists all awards won since January 1, 2006. Each
month I have to send a report that shows the wins for that month. I put a
"N" next to the award date to denote "new this month". Is there any way

to
automatically do this when I put in the date of the award and it is the
current month? Thanks for your help.

Mark




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Insert Criteria Based on Current Month

I cannot see that this is anything to do with this code, as it does not
create any formulae. It sounds as if you have a formula with a circular
reference. It should show the offending cell in the status bar, check it
back.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Mark Jackson" wrote in message
...
Bob,

I copied and paste the event code into the worksheet and now I get an

error
when I open the workbook. This is the error: Microsoft Excel cannot

calulate
a formula. Cell references in the formula's result, creating a circular
reference. Is there anyway to delete this or modify so it will work? Any
help is appreciated.

Sincerely,

Mark

"Bob Phillips" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error GoTo ws_exit
Application.EnableEvents = False
If Target.Column = 5 Then
If Month(Target.Value) = Month(Date) Then
Target.Offset(0, 1) = "N"
End If
End If

ws_exit:
Application.EnableEvents = True
On Error GoTo 0

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 Phillips

(remove nothere from the email address if mailing direct)

"Mark Jackson" wrote in message
...
Hello,

I have a worksheet that lists all awards won since January 1, 2006.

Each
month I have to send a report that shows the wins for that month. I

put a
"N" next to the award date to denote "new this month". Is there any

way
to
automatically do this when I put in the date of the award and it is

the
current month? Thanks for your help.

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
Referencing data in different worksheet based on month name cosmo_canuck Excel Worksheet Functions 3 August 22nd 05 07:27 AM
Insert a number of rows based on a value in a cell on active row iRocco Excel Discussion (Misc queries) 1 August 11th 05 06:18 AM
Current Month Query Sunshinegm Excel Worksheet Functions 1 February 15th 05 01:41 AM
UserForm to select current month or earlier Steve Excel Discussion (Misc queries) 2 January 21st 05 09:41 PM
Insert Month and Year in my worksheet Myrna Excel Worksheet Functions 1 November 8th 04 01:29 AM


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