ChDir (<directory path>)
'examples - changes current directory to Desktop folder ChDir "C:\UserA\Desktop"
ChDir (<directory path>)
'examples - changes current directory to Desktop folder ChDir "C:\UserA\Desktop"
ActiveSheet
'example ActiveSheet.Range("A1:A4") = "hello" ActiveSheet.Range("D1") = "world" ActiveSheet.Cells(2, 4).Value = "goodbye"
Date()
To hold this value in a variable, declare the type as Variant.
Now() ‘returns current time and date Time() ‘returns just the time
'to add a sheet at the very beginning of the Sheets tab Worksheets.Add Before:=Worksheets(1) 'to add a sheet at the very beginning of the Sheets tab Dim shtLast As Worksheet Set shtLast = .Worksheets(.Worksheets.Count) Set shtNew = Worksheets.Add(After:=shtLast) 'to add multiple sheets before the active sheet ThisWorkbook.Worksheets.Add Count:=<number of sheets you want to add> 'to add a new sheet before the current active sheet Dim sht as Worksheet Set sht = ThisWorkbook.Worksheets.Add sht.Name = "<name of new worksheet>"