Nilesh’s Weblog

August 12, 2008

Sleep in VBA

Filed under: Microsoft Excel — Tags: , , — deshnilesh @ 11:08 am

Here’s another known trick for VB/VBA, if you code a lot in C/Java and then switch to VB/VBA you might be surprized to know that there is no sleep function in VB. However there is a hack to implement it.

Just refer the library kernal32 for Sleep function and then use it!! Simple isn’t it?

This is what you need to put in –

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

The function can be called as usual –

Sleep (2000)
Advertisements

August 11, 2008

Excel Tools

Filed under: Microsoft Excel — Tags: , — deshnilesh @ 12:24 pm

Hey Guys, I was cleaning my disk to freeup some space and found 2 excel utilities which I have rarely used. Uploading here so that you can use it if you found them useful.

xlfdic01.xls – This file has good explanation of all excel functions and samples for them. I am not sure when and how I got this file but I think it comes with “Microsoft Data Analysis ToolPack”

>

unit conversion-all in one.xls – This file has multiple sheets which have following features/tools –

Wt vs water – Calculates amount of water you need to drink based on your weight
Ht vs Wt – Suggests the ideal weight for your height
calories Calculator – Calculates the amount of calories required based on your sex, weight, height and activity.
Calendar – Has calendar till 2078
Unit Conversion – This is most useful, it has almost all units.

Blog at WordPress.com.