Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Comments formating performance

I need help with writing better performance code for comments formating.
Here is my code:

For Each c In Cells.SpecialCells(xlCellTypeComments)

c.Comment.Visible = True
c.Comment.Shape.Select True
With Selection
.Placement = xlMoveAndSize
.PrintObject = True
.AutoSize = True
.Left = c.Left + c.Width + 3
.Top = c.Top + 2
End With
c.Comment.Visible = False
Next c

In sheet with ~550 comments it takes about 4 minutes.
Do you have any ideas ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default Comments formating performance

Try turning screenupdating off

Application.ScreenUpdating = False

(reset afterwards), and don't select the shape

With c.Comment.Shape

instead of


c.Comment.Shape.Select True
With Selection


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Vlado Sveda" wrote in message
...
I need help with writing better performance code for comments formating.
Here is my code:

For Each c In Cells.SpecialCells(xlCellTypeComments)

c.Comment.Visible = True
c.Comment.Shape.Select True
With Selection
.Placement = xlMoveAndSize
.PrintObject = True
.AutoSize = True
.Left = c.Left + c.Width + 3
.Top = c.Top + 2
End With
c.Comment.Visible = False
Next c

In sheet with ~550 comments it takes about 4 minutes.
Do you have any ideas ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Comments formating performance

Bob, thanks for your answer, but
1) screen updating is switched off (I posted only a part of my code)
2) code you recommended (With c.Comment.Shape) unfortunattely doesn't work
(in connection with .PrintObject, .AutoSize, ...)

thanks for your try ...

Vlado

"Bob Phillips" wrote:

Try turning screenupdating off

Application.ScreenUpdating = False

(reset afterwards), and don't select the shape

With c.Comment.Shape

instead of


c.Comment.Shape.Select True
With Selection


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Vlado Sveda" wrote in message
...
I need help with writing better performance code for comments formating.
Here is my code:

For Each c In Cells.SpecialCells(xlCellTypeComments)

c.Comment.Visible = True
c.Comment.Shape.Select True
With Selection
.Placement = xlMoveAndSize
.PrintObject = True
.AutoSize = True
.Left = c.Left + c.Width + 3
.Top = c.Top + 2
End With
c.Comment.Visible = False
Next c

In sheet with ~550 comments it takes about 4 minutes.
Do you have any ideas ?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default I found the problem

problem is in:
c.Comment.Visible = True

without this line running time is only ~ 1 second

.... but I don't know why ;-(

maybe the reason is that next lines operates with visible comment (?)
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default I found the problem

So, is it needed?

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Vlado Sveda" wrote in message
...
problem is in:
c.Comment.Visible = True

without this line running time is only ~ 1 second

... but I don't know why ;-(

maybe the reason is that next lines operates with visible comment (?)





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default I found the problem

I think (and hope) it isn't.

Vlado


"Bob Phillips" wrote:

So, is it needed?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2000 how to format the comments font all comments Delquestion Excel Discussion (Misc queries) 1 October 8th 09 02:19 PM
Formating cells with comments attached Carter[_2_] Excel Discussion (Misc queries) 8 September 17th 09 04:44 PM
in excel useing comments how do you add clip art to comments? dhouse New Users to Excel 2 July 18th 07 08:14 AM
XLL performance in NT and XP [email protected] Excel Programming 3 November 21st 05 10:36 AM
Install dates formating using conditional formating? Jerry Eggleston Excel Discussion (Misc queries) 2 November 9th 05 05:49 PM


All times are GMT +1. The time now is 08:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"