Select all cells that currently have data from a starting point “F1”:
Range(“F1”).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Select all cells that currently have data from a starting point “F1”:
Range(“F1”).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Turn Off Auto Cal:
Application.Calculation = xlCalculationManual
Turn On Auto Cal:
Application.Calculation = xlCalculationAutomatic
autocal
Have a message box pop up with an “OK” button
MsgBox “Starting Update ALL – Wait for Done Message!”
Switch to a different sheet:
Sheets(“Example_Sheet”).Select
Run a Macro from within a macro:
Application.Run “‘file_name.xlsm’!name_of_macro”
or
Application.Run “name_of_macro”
This is a list of common Excel Macro/VB script commands that I used daily. Seen something & wonder how it was done? Check these out!
- Run a Macro from within a macro:
Application.Run “‘file_name.xlsm’!name_of_macro”
or
Application.Run “name_of_macro”
- Switch to a different sheet:
Sheets(“Example_Sheet”).Select
- Have a message box pop up with an “OK” button:
MsgBox “Starting Update ALL – Wait for Done Message!”
- Turn Off Auto Cal:
Application.Calculation = xlCalculationManual
- Turn On Auto Cal:
Application.Calculation = xlCalculationAutomatic
- Select all cells that currently have data from a starting point “F1”:
Range(“F1”).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select- Clear the clipboard:
Application.CutCopyMode = False
- Set a variable to a value in a cell(X=Row,Y=Column):
variable_name = Worksheets(“sheet_name”).Cells(X, Y).Value
- Open a workbook with a filenamelocation that is configured from another cell value:
ChDir “C:Usersuser_namefolder_onefolder_two” Workbooks.Open Filename:= _”C:Usersuser_namefolder_namePart_of_file_name1″ & variable & “.xls”
- Clear the contents of the selected cells:
Selection.ClearContents
- Switch to a different open workbook:
Windows(“file name.xlsm”).Activate
- Paste Values only from current clipboard contents:
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False
- Run a Macro when a workbook opens (must be placed in the “ThisWorkbook” Object):
Private Sub Workbook_Open()
MsgBox “Auto Calculation has been disabled.”
Application.Calculation = xlCalculationManual
End Sub
This will return the last match, assuming your lookup value is in A1 and your return results are contained in column D….change as necessary. =LOOKUP(2,1/($C$1:$C$5201=A1),$D$1:$D$5201)
This is like using a vlookup from the bottom up.
Time HH:MM:SS to Decimal Hours | Formula ( 2 options) | |
6:30:00 | 6.5 | “=HOUR(D12) + (MINUTE(D12)/60) + (SECOND(D12)/60/60)” |
Format cell to General | ||
6:30:00 | 6.50 | “=A15/0.041666667” |
Format cell to Number | ||
Decimal Hours to Time HH:MM:SS | Formula | |
6.5 | 6:30:00 | “=A15*0.041666667” |
Format cell to Time |
How to convert Time HH:MM:SS to Seconds & Seconds to Time HH:MM:SS in Excel
C:C shows the Formula used in B:B
Time HH:MM:SS to Seconds | Formula | |
5:05:25 | 18325 | “=A2*86400” |
Seconds to Time HH:MM:SS | Formula | |
18325 | 5:05:25 | “=A5/86400” |
You must be logged in to post a comment.