Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Create comment from cell range

Does anyone know if it's possible to automatically create notes based off of
data from a range of cells?

For example Sheet1, Cell A2 would have a note that displays the data that
exists in the cells on Sheet 2, Cells B5-B7. As the data in Cells B5-B7
change, the note would automatically change as well, since it is displaying
whatever is contained in those cells at that time.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Create comment from cell range

This is easy using VBA:


Private Sub Worksheet_Change(ByVal Target As Range)
Dim r1 As Range
Dim r2 As Range
Set r1 = Range("B5:B7")
Set r2 = Sheets("Sheet1").Range("A2")

If Intersect(Target, r1) Is Nothing Then
Exit Sub
Else
s = Range("B5").Value & Range("B6").Value & Range("B7").Value
If r2.Comment Is Nothing Then
Else
r2.Comment.Delete
End If
r2.AddComment
r2.Comment.Visible = False
r2.Comment.Text Text:=s
End If
End Sub

Please that this goes in Sheet2 code, not a regular module, not in Sheet1
code.


Whenever the contents of B5 or B6 or B7 changes in Sheet2, the comment in
cell A2 in Sheet1 will be updated.
--
Gary's Student


"MikeG" wrote:

Does anyone know if it's possible to automatically create notes based off of
data from a range of cells?

For example Sheet1, Cell A2 would have a note that displays the data that
exists in the cells on Sheet 2, Cells B5-B7. As the data in Cells B5-B7
change, the note would automatically change as well, since it is displaying
whatever is contained in those cells at that time.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Create comment from cell range

Gary,
That's great! I honestly didn't expect an answer, but this works perfectly.
Thanks so much!

"Gary''s Student" wrote:

This is easy using VBA:


Private Sub Worksheet_Change(ByVal Target As Range)
Dim r1 As Range
Dim r2 As Range
Set r1 = Range("B5:B7")
Set r2 = Sheets("Sheet1").Range("A2")

If Intersect(Target, r1) Is Nothing Then
Exit Sub
Else
s = Range("B5").Value & Range("B6").Value & Range("B7").Value
If r2.Comment Is Nothing Then
Else
r2.Comment.Delete
End If
r2.AddComment
r2.Comment.Visible = False
r2.Comment.Text Text:=s
End If
End Sub

Please that this goes in Sheet2 code, not a regular module, not in Sheet1
code.


Whenever the contents of B5 or B6 or B7 changes in Sheet2, the comment in
cell A2 in Sheet1 will be updated.
--
Gary's Student


"MikeG" wrote:

Does anyone know if it's possible to automatically create notes based off of
data from a range of cells?

For example Sheet1, Cell A2 would have a note that displays the data that
exists in the cells on Sheet 2, Cells B5-B7. As the data in Cells B5-B7
change, the note would automatically change as well, since it is displaying
whatever is contained in those cells at that time.


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
Cell address in a range starguy Excel Discussion (Misc queries) 7 May 3rd 06 11:58 AM
Cell Reference with Range Name SCSC Excel Worksheet Functions 2 March 23rd 06 11:32 PM
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
cell comment Jack Sons Excel Discussion (Misc queries) 5 December 1st 05 05:15 PM


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