var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Defining the location a comment shows
I have a code that adds comments and fill with pics.
Is it possible to define the location the comment will show when you mouse over. I know you can move around the comment box once it appers.
The code I use is
Dim rng As Range
Dim shp As Comment
Set rng = ActiveCell
If ActiveCell.Value = "Click to add pic" Then
fn = Application.GetOpenFilename
If fn = False Then
Set shp = rng.AddComment("")
shp.Shape.Height = 322
shp.Shape.Width = 465
ActiveCell = "QC Pic"
This is how I add comments automatically to a range of cells. You need to have the data for the comments stored in a worksheet where you can read them. In my case, the comment text is in Sheets(2) in the same column and cells where they will be added to Sheet1. I test for text in column A on Sheet1 and stop adding comments when a blank cell in encountered, which in my application is the end of the data.
Next I set properties of each comment to ensure they are not visible until the mouse is dragged over the cell, and resize the comments to reduce the size of the retangular comment box.
While Trim(ActiveCell.Value) <> ""
Range(ActiveCell.Address).Comment.Visible = False
Text:=Sheets(2).Cells(ActiveCell.Row, ActiveCell.Column + 1).Value & ""
I hope this helps in what you are doing.
Dim c As Comment
For Each c In ActiveSheet.Comments
c.Visible = False
c.Shape.Locked = False
c.Shape.TextFrame.AutoSize = True
A correction--the comment text I add is actually text that is in column B of Sheets(2), which happens to be a name for a code in column A.