Jason Campbell
Board Regular
- Joined
- Mar 22, 2016
- Messages
- 77
Hi all,
I have the need to specify comments to Auto-size in respect of height, but have a specified/static width of 9.26cm.
The reason for this is that the comments are being used as a guide to requirements that must be met to enrol on a course. The comment box cannot exceed the width of 9.26cm, however must be able to auto-size in respect of height, so as to enable to written content to be displayed and viewed.
As a new fledgling to Excel, I'm now aware that there are numerous gremlins as regards to the Excel Comments and will need to make use of VBA to get the comments to do exactly what I want.
I've already made use of the below macro to realign/anchor comments that keep jumping all over the place, thanks to a post on MrExcel... all I need to do now is auto-size the comment box height and give it a static specific width of 9.26cm!!
Could anyone give me a few pointers?
Further, whenever the data is filtered, I have to run the macro below again...is there anyway that I can create a macros to automatically re-anchor the comments after clearing the filters?
I thought Microsoft Would of nailed this one by now...
Sub ResetComments()
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Shape.Top = cmt.Parent.Top + 5
cmt.Shape.Left = _
cmt.Parent.Offset(0, 1).Left + 5
Next
End Sub
I have the need to specify comments to Auto-size in respect of height, but have a specified/static width of 9.26cm.
The reason for this is that the comments are being used as a guide to requirements that must be met to enrol on a course. The comment box cannot exceed the width of 9.26cm, however must be able to auto-size in respect of height, so as to enable to written content to be displayed and viewed.
As a new fledgling to Excel, I'm now aware that there are numerous gremlins as regards to the Excel Comments and will need to make use of VBA to get the comments to do exactly what I want.
I've already made use of the below macro to realign/anchor comments that keep jumping all over the place, thanks to a post on MrExcel... all I need to do now is auto-size the comment box height and give it a static specific width of 9.26cm!!
Could anyone give me a few pointers?
Further, whenever the data is filtered, I have to run the macro below again...is there anyway that I can create a macros to automatically re-anchor the comments after clearing the filters?
I thought Microsoft Would of nailed this one by now...
Sub ResetComments()
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Shape.Top = cmt.Parent.Top + 5
cmt.Shape.Left = _
cmt.Parent.Offset(0, 1).Left + 5
Next
End Sub