Académique Documents
Professionnel Documents
Culture Documents
http://www.excelforum.com/excel-programming-vba-macros/680566-he...
My Profile
Settings
Log Out
Forum
What's New?
Members List
Calendar
Forum Rules
Winner Board
Advanced Search Quick Links
New Posts My Posts Private Messages User CP FAQ Calendar Community Unanswered Threads
Forum Actions
Forum
Microsoft Office Application Help - Excel Help forum Help with comment VBA code.
partho143, You are member of Excel Help Forum for 989 day(s) now but haven't posted anything yet. How about introducing yourself to the rest of the users? Click on this message bar if you wish to make an introduction thread now. If you wish to post a question, please choose the relevant sub-forum.
Results 1 to 3 of 3
04-21-2009, 05:45 PM
#1
Marco-Kun
Valued Forum Contributor
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'www.contextures.com/xlcomments03.html Dim rng As Range Dim cTop As Long Dim cWidth As Long Dim cmt As Comment Dim sh As Shape ''' Application.DisplayCommentIndicator _ = xlCommentIndicatorOnly If Not m_cmtPrevious Is Nothing Then m_cmtPrevious.Visible = False End If Set rng = ActiveWindow.VisibleRange cTop = rng.Top + rng.Height / 2 cWidth = rng.Left + rng.Width / 2 If ActiveCell.Comment Is Nothing Then 'do nothing Set m_cmtPrevious = Nothing Else Set cmt = ActiveCell.Comment Set sh = cmt.Shape sh.Top = ActiveCell.Offset(1).Top sh.Left = ActiveCell.Offset(1).Left cmt.Visible = True Set m_cmtPrevious = cmt End If
1 of 4
12/02/2013 2:52 PM
http://www.excelforum.com/excel-programming-vba-macros/680566-he...
the selected cell and is aligned to the left. What do I have to adjust to make it align to the right 1 cell below the selected cell.
04-21-2009, 05:58 PM
#2
shg
Forum Guru
With ActiveCell.Offset(1) sh.Top = .Top sh.Left = .Left + .Width - sh.Width End With
Reply
04-21-2009, 06:05 PM
#3
Marco-Kun
Valued Forum Contributor
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'www.contextures.com/xlcomments03.html Dim rng As Range Dim cTop As Long Dim cWidth As Long Dim cmt As Comment Dim sh As Shape ''' Application.DisplayCommentIndicator _ = xlCommentIndicatorOnly If Not m_cmtPrevious Is Nothing Then m_cmtPrevious.Visible = False End If
2 of 4
12/02/2013 2:52 PM
http://www.excelforum.com/excel-programming-vba-macros/680566-he...
Set rng = ActiveWindow.VisibleRange cTop = rng.Top + rng.Height / 2 cWidth = rng.Left + rng.Width / 2 If ActiveCell.Comment Is Nothing Then 'do nothing Set m_cmtPrevious = Nothing Else Set cmt = ActiveCell.Comment Set sh = cmt.Shape sh.Top = ActiveCell.Offset(1).Top sh.Left = ActiveCell.Offset(1).Left cmt.Visible = True With ActiveCell.Offset(1) sh.Top = .Top sh.Left = .Left + .Width - sh.Width End With Set m_cmtPrevious = cmt End If
Reply
Top
Go Advanced
Cancel
3 of 4
12/02/2013 2:52 PM
http://www.excelforum.com/excel-programming-vba-macros/680566-he...
All times are GMT +3. The time now is 02:50 PM. Powered by vBulletin Version 4.1.8 Copyright 2012 vBulletin Solutions, Inc. All rights reserved.
4 of 4
12/02/2013 2:52 PM