Adding formatting rules for Comments in Macro

P

pmipalma

Hello All

I have the following macro at the moment

For Each cell In Range("AA19:AA95")
Cells(cell.Row, "G").NoteText Text:=cell.Text
Next
End Sub

It is an easy and quick way to have the data shows as comment in column
G

But now i want to format the data and received the code

rngCells.Areas(1).Cells(lCnt).Comment.Shape.TextFrame.Characters.Font.Size
= 14

'rngCells.Areas(1).Cells(lCnt).Comment.Shape.TextFrame.AutoSize = True
rngCells.Areas(1).Cells(lCnt).Cells.Comment.Shape.Width =
400
rngCells.Areas(1).Cells(lCnt).Cells.Comment.Shape.Height =
200

But when i will make the following code it is not working

For Each cell In Range("AA19:AA95")
Cells(cell.Row, "G").NoteText Text:=cell.Text
rngCells.Areas(1).Cells(lCnt).Comment.Shape.TextFrame.Characters.Font.Size
= 14

'rngCells.Areas(1).Cells(lCnt).Comment.Shape.TextFrame.AutoSize = True
rngCells.Areas(1).Cells(lCnt).Cells.Comment.Shape.Width =
400
rngCells.Areas(1).Cells(lCnt).Cells.Comment.Shape.Height =
200
Next
End Sub


What should i do to get all the Comment data been formatted correctly??
 
C

Carim

Hi,

In whatever range you select :
Range("A1").AddComment
Range("A1").Comment.Text Text:="Please format as follows...."

HTH
Cheers
Carim
 
P

pmipalma

Hi Carim,

Thanks for your answer.

But when i would use this it will not update automatically my field in
column G (G19:G95)

Can somebody send to me the complete coding for this please?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top