I am trying to add comments to a cell, but with multiple lines...any clues?
When I use the GUI interface (right click a cell, insert comment, and then I can type mutliple lines of text. How do you get it done in VBA?
On a particular cell, I want 5 lines of data. Here is my code so far.
First I am setting up some variables to store cell info into:
PartID = Cells(nRow, 9).Value
WorkOrder = Cells(nRow, 10).Value
SeqNo = Cells(nRow, 15).Value
Resource = Cells(nRow, 17).Value
WORecv = Cells(nRow, 12).Value
WOQty = Cells(nRow, 11).Value
OperQty = Cells(nRow, 18).Value
Then at a different cell in the worksheet, I want to record the info on 5 lines of comments.
With Cells(WOLin, nCol).AddComment
.Visible = False
.Text PartID
.Text WorkOrder & " / " & SeqNo & " " & Resource
' .Text "WO Recd = " & WORecv
' .Text "WO Desired = " & WOQty
' .Text "OperQty = " & OperQty
.Shape.TextFrame.AutoSize = True
End With
It just always takes the last text line. So right now, all I get is:
W32060 / 30 PLTPAS
I want to get:
TAYL0097
W32060 / 30 PLTPAS
WO Recd = 0
WO Desired = 100,000
OperQty = 2,000
Any help would be appreciated!
TIA,
moestroz
When I use the GUI interface (right click a cell, insert comment, and then I can type mutliple lines of text. How do you get it done in VBA?
On a particular cell, I want 5 lines of data. Here is my code so far.
First I am setting up some variables to store cell info into:
PartID = Cells(nRow, 9).Value
WorkOrder = Cells(nRow, 10).Value
SeqNo = Cells(nRow, 15).Value
Resource = Cells(nRow, 17).Value
WORecv = Cells(nRow, 12).Value
WOQty = Cells(nRow, 11).Value
OperQty = Cells(nRow, 18).Value
Then at a different cell in the worksheet, I want to record the info on 5 lines of comments.
With Cells(WOLin, nCol).AddComment
.Visible = False
.Text PartID
.Text WorkOrder & " / " & SeqNo & " " & Resource
' .Text "WO Recd = " & WORecv
' .Text "WO Desired = " & WOQty
' .Text "OperQty = " & OperQty
.Shape.TextFrame.AutoSize = True
End With
It just always takes the last text line. So right now, all I get is:
W32060 / 30 PLTPAS
I want to get:
TAYL0097
W32060 / 30 PLTPAS
WO Recd = 0
WO Desired = 100,000
OperQty = 2,000
Any help would be appreciated!
TIA,
moestroz