Anyone out there clever enough to tell me how to sequentially populate
the comments field in cells... the problem I can see is that the cells
are in a grid of A5-10 through to i5 to 10, I want them populating
a5,a6,a7,a8,a9,a10,b5,b6 etc and when I get to i10 I want the sequence
to carry over to the next sheet...
Don't want much do I ;)
TIA
Nick
Sorry if this appears twice, posted via Google Groups and it's not
appeared yet...
Dave Peterson - 18 Apr 2008 17:37 GMT
Option Explicit
sub Testme()
Dim cCtr as long
dim myCell as range
dim myCol as range
dim myArea as range
dim myRng as range
dim myAddr as string
dim wks as worksheet
myaddr = "a5:I10"
cctr = 0
for each wks in activeworkbook.worksheets
Set myrng = wks.range(myaddr)
for each myarea in myrng.areas
for each myCol in myarea.columns
for each mycell in mycol.cells
cctr = cctr + 1
if mycell.comment is nothing then
'do nothing
else
mycell.comment.delete
end if
mycell.addcomment text:=format(cctr,"0000")
next mycell
next mycol
next myarea
next wks
End sub
I have no idea what you really want in your comments, so I just plopped in a
sequence of numbers--while deleting the existing comments!
> Anyone out there clever enough to tell me how to sequentially populate
> the comments field in cells... the problem I can see is that the cells
[quoted text clipped - 10 lines]
> Sorry if this appears twice, posted via Google Groups and it's not
> appeared yet...

Signature
Dave Peterson
NickTheBatMan - 19 Apr 2008 10:01 GMT
> Option Explicit
> sub Testme()
[quoted text clipped - 52 lines]
>
> - Show quoted text -
Excellent Dave, that works :)
Many thanks :)