ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   add comment in the loop (https://www.excelbanter.com/excel-programming/406532-add-comment-loop.html)

Souris

add comment in the loop
 
I have following code to add comment to my cells from MS Acess tbale

ActiveSheet.Cells(i, j + 1).AddComment MyDatabase.Fields(j - 1).Value

It works and adds comment to my cell.

The problem is when it is in the loop which does not add second row of
comments.

Application.Wait (Now + TimeValue("0:00:03"))

I have to add the wait 3 seconds command in the loop and it adds second row
of comments.

Does it make sense that it needs 3 seconds to add one row of comments?
It will be too long if I have a couple lines.

Any ideas or work around for this?

Your information is great appreciated,


Kalpesh[_2_]

add comment in the loop
 
Hi,

How about adding Application.ScreenUpdating = false before the loop.
And, set it to true once the loop is over.

Does that work?

Kalpesh

Souris

add comment in the loop
 
I had to add wait to fill the spreadsheet.
I tried to use screen updating, but it is the same,

Thanks again for helping,

"Kalpesh" wrote:

Hi,

How about adding Application.ScreenUpdating = false before the loop.
And, set it to true once the loop is over.

Does that work?

Kalpesh



All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com