wevia

u/wevia






r/vba•

Hi

I'm trying to add a comment to a cell with text from another cell, but all I get is "type mismatch".

This is what I'm trying:

ActiveWorkbook.Sheets(1).Cells(y1, x1).AddComment

ActiveWorkbook.Sheets(1).Cells(y1, x1).Comment.Text (ActiveWorkbook.Sheets(2).Cells(y2, x2).Value)

I'm also tried to use str() around the value cell, but still get the same error.

Anyone know how I can get this to work?

EDIT: I found the solution. I need to use .text instead of .value

ActiveWorkbook.Sheets(1).Cells(y1, x1).Comment.Text (ActiveWorkbook.Sheets(2).Cells(y2, x2).text)

32

r/trees•

If everything is relative, could our universe be somewhere between a bigger subatomic particle and a smaller universe?

Hope I make sense

413