Hi all
I'm trying to use a macro to update the comments on a range, the comments are picked up from another sheet named "Data" using Vlookup.
Basically from Cells(3,21) to Cells(3,32) are months, the cells below from Cells(4,21) to Cells(4,32) are data for the months, I need to insert comments on each of the data cells. My idea is to using a loop to update Cells(1,1) with comment picked up using Vlookup and then insert the comment to the cells.
Every time I run the Macro, the existing comment is cleared first. That's what I got with Macro below.
Now what I want is that if the new comment picked up is empty (cells(1,1)) then after clearing the existing comment I don't want to add a empty comment box to the data cell. I want to continue the loop. So I insert "If Not IsEmpty(sText) Then" after the comment clearing line, but excel gives me a "Next without For" error. Could anyone tell me where went wrong?![]()
Please Login or Register to view this content.
Another question is that is it possible to reference cell in another sheet directly using Vlookup without having to use a proxy cell like cells(1,1)?
The third question is that I don't understand what "With WorksheetFunction" doing here? Why it it outside the loop and what is "With" command anyway?
Thank you very much.
Bookmarks