Sub bleh()
Call blah(activecell, 1000, 999) 'change the '1000' and '999' based on what size you want 1000 is the width 999 the height
End Sub
Sub blah(rng As Range, x as long, y as long)
Dim cmmt As Comment
Set cmmt = rng.AddComment
cmmt.Visible = True
With cmmt.Shape
.Height = y
.Width = x
End With
End Sub
Sub Com_box()
Call Com_box(ActiveCell, 12, 15) 'change the '1000' and '999' based on what size you want 1000 is the width 999 the height
End Sub
Sub Com_box(rng As Range, x As Long, y As Long)
Dim cmmt As Comment
Set cmmt = rng.AddComment
cmmt.Visible = True
With cmmt.Shape
.Height = 2
.Width = 4
End With
End Sub
Sub Com_box()
Call Com_size(ActiveCell, 12, 15) 'change the '1000' and '999' based on what size you want 1000 is the width 999 the height
End Sub
Sub Com_size(rng As Range, x As Long, y As Long)
Dim cmmt As Comment
Set cmmt = rng.AddComment
cmmt.Visible = False
With cmmt.Shape
.Height = 200
.Width = 400
End With
End Sub
Sub Com_size(rng As Range, x As Long, y As Long)
Also now that I have this, my next step or next question is...Can I have the comment box start out with some default text in it? I am looking up and putting specific information into the comment, it is always the same, so I would like to add my default Headings to the Comment if possible.
Sub Com_box()
'calls the sub
'activecell is the cell to add the comment to
'12 is the width
'15 is the height
Call Com_size(ActiveCell, 120, 150)
End Sub
Sub Com_size(rng As Range, x As Long, y As Long)
'rng, x and y are the parameters
'they have these values you assigned from the first sub
'rng = activecell
'x = 120
'y = 150
'dimension a comment variable called cmmt
Dim cmmt As Comment
'resumes next line when error occurs
On Error Resume Next
'try to delete comment even if there is none ther
'thats why error handling is resume next
rng.Comment.Delete
'error handling returns to default
On Error GoTo 0
'uses addcomment method to add a new comment to the activecell and
'sets it so can be referenced with cmmt variable
Set cmmt = rng.AddComment
'sets commentbox visible to false
cmmt.Visible = False
With cmmt.Shape
'sets the height to the value of y
.Height = y
'set the width to the value of x
.Width = x
End With
cmmt.Text ActiveSheet.Cells(1, rng.Column).Value & " " & ActiveSheet.Cells(2, rng.Column).Value
End Sub