Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2008

Tip: Looking for answers? Try searching our database.

Can I auto populate Comments in sequence over different sheets ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NickTheBatMan - 18 Apr 2008 17:07 GMT
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 :)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.