Thursday, May 14, 2015

Arrays in vbscript

ActiveSheet.Range("$A$1:$CN$25425").AutoFilter Field:=37, Criteria1:=Array( _
        "Bartlett Toni M", "Clanton Jason P P", "Hackman Courtney T T", _
        "Tramutolo Arthur A"), Operator:=xlFilterValues

 

Friday, May 8, 2015

Inbuiltfunctions

- System Time and Date

'Below code will give you system date and time
Workbooks("Projectresourcedetailsextract.xlsm").Sheets("Sheet1").Range("K1").Formula = "=Now()"

 'To format the date
To expound on Numenor's answer you can do something like, Format(Now(),"HH:mm:ss") using these custom date/time formating options

 

Thursday, May 7, 2015

Pending

5/7/15:

Scenarios i wanted to implemente:
- I wanted to count the number of rows(with data) in excel sheet
- After applying filter, i wanted to count rest of the rows
- Create graph based on the data available in the table. select your own xaxis and yaxis.
- Refresh the excel data with macro, sometimes the formula doesnot get triggered
- I am trying to go through each and every filtered cell, if i used for loop using Range, it is going through each of the rows, that is even non filtered rows.

Saturday, May 2, 2015

CreateObject(servername.typename[,location]) ----vbscript

4/30/15

CreateObject(servername.typename[,location])

ParameterDescription
servername Required. The name of the application that provides the object
typename Required. The type/class of the object
location Optional. Where to create the object


Ex:
Set objReg=CreateObject("vbscript.regexp")   - to work on regular expression
Set Exlobj = CreateObject("Excel.Application") - to work on excel application
Set fso = CreateObject("Scripting.FileSystemObject") -