1) Changing format: text into value
2) Date can be convert into text
3) Saving activeWorkbook as "csv" with date stamp
4) Swifting workbooks
1) Transfering Table into excel file (it is NOT limited to 65k rows)
1) Deleting files and folders
2)Order to wait
3) Declaration responsible for opening new window in maximum size
3a) Opening Internet Explorer Web Browser and navigation to http site (using declaration)
4) Opening folder
1) Changing format: text into value
Selection.NumberFormat = "0.00"
For Each xCell In Selection
xCell.Value = CDec(xCell.Value)
Next xCell
Selection.NumberFormat = "@"
ActiveWorkbook.SaveAs FileName:= _
"C:\MyPath\MyFileName_" & Format(Date, "yyyymmdd") & ".csv", FileFormat:= _
xlCSV, CreateBackup:=False
Application.ActiveSheet
or
ActiveWorkbook.ActiveSheet
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "TableName", "C:\MyPath\MyFileName.xlsx", True
aFile = "C:\Programy\MyHtmlFile.htm" ' kills single file
If Len(Dir$(aFile)) > 0 Then
Kill aFile
Kill "C:\Programy\MyFiles\*.*" ' kills every file in tjhe folder
RmDir "C:\Programy\MyFolder\" ' kills folder (files must be deleted at first)
End If
The first method
Dim currenttime As Date
currenttime = Now
Do Until currenttime + TimeValue("00:00:05") <= Now
Loop
The second method
If Application.Wait(Now + TimeValue("0:00:10")) Then
MsgBox "Your session has expired"
End If
Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Global Const SW_MAXIMIZE = 3
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWNORMAL = 1
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
apiShowWindow IE.hwnd, SW_MAXIMIZE
On Error Resume Next
IE.navigate "http://Ilearn.com.pl"
Set IE = Nothing
Dim str_folder As String
str_folder = "C:\folder\Yourfolder\" ' folder to open
Call Shell("explorer.exe " & str_folder, vbNormalFocus)
With Selection
.Replace What:="before", Replacement:="after"
.Replace What:="Mbefore", Replacement:="after"
End With
start1 = Time()
stop1 = Time()
TimeElapsed = stop1 - start1
MsgBox Format(sngElapsed, "hh:mm:ss")
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False