ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Wait less than a second (https://www.excelbanter.com/excel-programming/339364-wait-less-than-second.html)

Claus[_3_]

Wait less than a second
 
Hi

I would like to delay the hiding of 4 columns, someting like

Columns("R").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("S").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("T").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("U:").Hidden = True

How do i define a time less than a second ?

Hoping for an answer


Regards,
Claus



RB Smissaert

Wait less than a second
 
Put this at the very top of your code module:

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Then where you want to wait put something like this:

Wait 500 'wait 0.5 seconds


RBS


"Claus" wrote in message
...
Hi

I would like to delay the hiding of 4 columns, someting like

Columns("R").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("S").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("T").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("U:").Hidden = True

How do i define a time less than a second ?

Hoping for an answer


Regards,
Claus



Claus[_3_]

Wait less than a second
 
Thank you

It works when i replace "Wait" with "Sleep"

Regards,
Claus
"RB Smissaert" skrev i en meddelelse
...
Put this at the very top of your code module:

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Then where you want to wait put something like this:

Wait 500 'wait 0.5 seconds


RBS


"Claus" wrote in message
...
Hi

I would like to delay the hiding of 4 columns, someting like

Columns("R").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("S").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("T").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("U:").Hidden = True

How do i define a time less than a second ?

Hoping for an answer


Regards,
Claus





RB Smissaert

Wait less than a second
 
Yes, it should be sleep. Just had your wait in mind.

RBS

"Claus" wrote in message
...
Thank you

It works when i replace "Wait" with "Sleep"

Regards,
Claus
"RB Smissaert" skrev i en meddelelse
...
Put this at the very top of your code module:

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Then where you want to wait put something like this:

Wait 500 'wait 0.5 seconds


RBS


"Claus" wrote in message
...
Hi

I would like to delay the hiding of 4 columns, someting like

Columns("R").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("S").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("T").Hidden = True
Application.Wait (Now + TimeValue("0:00:01"))
Columns("U:").Hidden = True

How do i define a time less than a second ?

Hoping for an answer


Regards,
Claus







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

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