Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary
 
Posts: n/a
Default I am trying to add notes to a drop down list

I have a drop down list that has Late and Left early. I am trying to add
notes to these two drop down items. That is if a manager puts in left early
they get directed to a comments section so that they can add the reason, and
review it at a future date.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
L. Howard Kittle
 
Posts: n/a
Default I am trying to add notes to a drop down list

Hi Gary,

Paste this in your worksheet code module. Also I entered =TODAY() in cell
E1 and assumed F1 as having the drop down. Change to suit and adjust the
code to comply.

Gives you a list of "lates" or "earlys" in column A and a visible comment
with date and excuse.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.EnableEvents = False
If Target < Range("F1") Then Exit Sub
Range("A100").End(xlUp).Offset(1, 0).Select

With Selection
.AddComment
.Comment.Text Text:=Range("E1").Value & ":" _
& Chr(10) & Range("F1").Value
.Comment.Visible = True
.Value = Range("F1").Value
End With

Range("F1").ClearContents
Range("F1").Select
Application.EnableEvents = True
End Sub

HTH
Regards,
Howard

"Gary" wrote in message
...
I have a drop down list that has Late and Left early. I am trying to add
notes to these two drop down items. That is if a manager puts in left
early
they get directed to a comments section so that they can add the reason,
and
review it at a future date.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
L. Howard Kittle
 
Posts: n/a
Default I am trying to add notes to a drop down list

Hi Gary,

The code I offered you seems to work fine until you clear the series of
comments compiled in cloumn A. Then it seems to "just not respond" to a
change in F1 as it did before. I save and close Excel and reopen and it
works fine.

I have post to the group looking for a solution.

Regards,
Howard

"Gary" wrote in message
...
I have a drop down list that has Late and Left early. I am trying to add
notes to these two drop down items. That is if a manager puts in left
early
they get directed to a comments section so that they can add the reason,
and
review it at a future date.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary
 
Posts: n/a
Default I am trying to add notes to a drop down list



"L. Howard Kittle" wrote:

Hi Gary,

The code I offered you seems to work fine until you clear the series of
comments compiled in cloumn A. Then it seems to "just not respond" to a
change in F1 as it did before. I save and close Excel and reopen and it
works fine.

I have post to the group looking for a solution.

Regards,
Howard

"Gary" wrote in message
...
I have a drop down list that has Late and Left early. I am trying to add
notes to these two drop down items. That is if a manager puts in left
early
they get directed to a comments section so that they can add the reason,
and
review it at a future date.



Thanks for the module. I tried putting it in but cant get it to work, I have never added a macro to excel before. so it is definately something i am doing wrong.

thanks for your help.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary
 
Posts: n/a
Default I am trying to add notes to a drop down list



"L. Howard Kittle" wrote:

Hi Gary,

The code I offered you seems to work fine until you clear the series of
comments compiled in cloumn A. Then it seems to "just not respond" to a
change in F1 as it did before. I save and close Excel and reopen and it
works fine.

I have post to the group looking for a solution.

Regards,
Howard

"Gary" wrote in message
...
I have a drop down list that has Late and Left early. I am trying to add
notes to these two drop down items. That is if a manager puts in left
early
they get directed to a comments section so that they can add the reason,
and
review it at a future date.



Also the drop down box can be in almost any column, as i have the spreadsheet covering the whole year broken down by daysand at the top i do a formula that adds the number of occurrances for late left early sick, comp day vacation, etc. i tried doing a screen print and a paste but the editor screws up the paste.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
L. Howard Kittle
 
Posts: n/a
Default I am trying to add notes to a drop down list

Hi Gary,

I got some advice from Chip P, an MVP, on my code and it works for me on my
sheet. If the "Target "Range("F1")" moves about on your sheet, we have a
problem.

If you would like, send me a sample worksheet and advice on what you want to
happen an I will be glad to at least take a look at it.

Do the obvious here... lhkittle at dot comcast dot net

Regards,
Howard
lhkittle at dot comcast dot net


Thanks Chip, I changed...

If Target < Range("F1") Then Exit sub

To:

If Target < Range("F1") Then
Application.EnableEvents = True
Exit Sub
End If

WOW, seems to have solved the problem.
Have to admit, I do not understand why the "select rows delete comments"
event would bust the code. Also I delete cell contents... but whatever???

Thanks a ton Chip, always a pleasure!
Regards,
Howard

New code...

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.EnableEvents = False

If Target < Range("F1") Then
Application.EnableEvents = True
Exit Sub
End If

Range("A100").End(xlUp).Offset(1, 0).Select

With Selection
.AddComment
.Comment.Text Text:=Range("E1").Value & ":" _
& Chr(10) & Range("F1").Value
.Comment.Visible = True
.Value = Range("F1").Value
End With

Range("F1").ClearContents
Range("F1").Select
Application.EnableEvents = True
End Sub
"Gary" wrote in message
...
I have a drop down list that has Late and Left early. I am trying to add
notes to these two drop down items. That is if a manager puts in left
early
they get directed to a comments section so that they can add the reason,
and
review it at a future date.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
gary
 
Posts: n/a
Default I am trying to add notes to a drop down list



"L. Howard Kittle" wrote:

Hi Gary,

I got some advice from Chip P, an MVP, on my code and it works for me on my
sheet. If the "Target "Range("F1")" moves about on your sheet, we have a
problem.

If you would like, send me a sample worksheet and advice on what you want to
happen an I will be glad to at least take a look at it.

Do the obvious here... lhkittle at dot comcast dot net

Regards,
Howard
lhkittle at dot comcast dot net


Thanks Chip, I changed...

If Target < Range("F1") Then Exit sub

To:

If Target < Range("F1") Then
Application.EnableEvents = True
Exit Sub
End If

WOW, seems to have solved the problem.
Have to admit, I do not understand why the "select rows delete comments"
event would bust the code. Also I delete cell contents... but whatever???

Thanks a ton Chip, always a pleasure!
Regards,
Howard

New code...

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.EnableEvents = False

If Target < Range("F1") Then
Application.EnableEvents = True
Exit Sub
End If

Range("A100").End(xlUp).Offset(1, 0).Select

With Selection
.AddComment
.Comment.Text Text:=Range("E1").Value & ":" _
& Chr(10) & Range("F1").Value
.Comment.Visible = True
.Value = Range("F1").Value
End With

Range("F1").ClearContents
Range("F1").Select
Application.EnableEvents = True
End Sub
"Gary" wrote in message
...
I have a drop down list that has Late and Left early. I am trying to add
notes to these two drop down items. That is if a manager puts in left
early
they get directed to a comments section so that they can add the reason,
and
review it at a future date.



Hi Howard,


i sent the spreadsheet for your review.

thanks,

gary

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
Conditional Drop Down List Bogo Excel Discussion (Misc queries) 2 February 16th 06 09:11 PM
Populating worksheet via a drop down list ! kuansheng Excel Worksheet Functions 4 February 14th 06 05:48 AM
changing value of a cell by selecting an item from a drop down list Bobby Mir Excel Worksheet Functions 6 June 8th 05 08:33 PM
Drop Down List Sandy Excel Worksheet Functions 3 January 11th 05 10:50 PM
Drop List Referencing Boony Excel Worksheet Functions 2 November 11th 04 11:42 AM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"