excel - VBA: Add comments to cells from other cells content if another cell = 1 -
I need to add comments to cells using the contents of cell.offset (, 23) if cell.offset (, 45 ) = 1
This is what I have tried:
Sub CellToCmt2 () Select the range for each C of the selection if target.Offset (, 45) & Lt; & Gt; 1 Then start again if target.Offset (, 45) = 1 then applications. Enable Events = Resume with incorrect error with c.Offset (, 23). Note text: =. Goal end with goal GoTo 0 End on ClearContents Error Any help would be greatly appreciated Edit: I have a code that works Sub CellToCmt2 () is dimmed as a range for each C in the selection if c.Offset (, 45) = 1 then start again with the error again with C. NoteText Text: = c.Offset (, 23). Target with value. GoTo 0 ends on the ClearContents error if the next C & sub
For one, This bit does nothing:
if target.Offset (, 45) & lt; & Gt; 1 Then start again next
Regardless of the conditions are met, you move on to the next step. As well as take it out completely.
In addition, when I use the macro recorder to input a comment, I get the code:
c.Comment.Text text: = "test"
Try "comment text" rather than "nottext."
Edit:
You may want to change
P>
with c.Offset (, 23) Note text: =. Value End with
To
c.NoteText text: = c.Offset (, 23). Value
Comments
Post a Comment