LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default even the codes in microsoft's help section don't work

i found this code by pressing screenupdating in the help section of vba. it
doesn't work. it says i is undefined. so i write dim i as integer. then it
says starttime is undefined.

Dim elapsedTime(2)
Application.screenupdating = True

For i = 1 To 2
If i = 2 Then Application.screenupdating = False
startTime = Time
Worksheets("Sheet1").Activate
For Each c In ActiveSheet.Columns
If c.Column Mod 2 = 0 Then
c.Hidden = True
End If
Next c
stopTime = Time
elapsedTime(i) = (stopTime - startTime) * 24 * 60 * 60
Next i
Application.screenupdating = True
MsgBox "Elapsed time, screen updating on: " & elapsedTime(1) & _
" sec." & Chr(13) & _
"Elapsed time, screen updating off: " & elapsedTime(2) & _
" sec."

 
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
How do I: If Pie Section Label = X, Make Pie Section Color = Y MikeZz Excel Programming 2 September 3rd 08 08:35 PM
Microsoft's drop down box Sulley Excel Programming 3 March 12th 07 01:28 AM
Excel 2007. How to Get Microsoft's Attention Chaplain Doug Excel Programming 2 February 16th 07 05:54 PM


All times are GMT +1. The time now is 09:56 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"