VBA Snippets


Macros_MacroNotWrittenYet

Public Sub Message_MacroNotWrittenYet( _
ByVal sSubroutineName As String)

Dim sMessage As String
sMessage = "The subroutine '" & sSubroutineName & "' has not been written yet"
Call MsgBox(sMessage, vbOKOnly + vbInformation, g_sCOMPANYNAME & " (" & g_sVERSION & ") - " & "Not Written Yet")
Call Tracer_Add("MESSAGE", sMessage)
End Sub

Question_TakeALongTime

Public Function Question_TakeALongTime( _
ByVal objCellRange As Range) As VbMsgBoxResult

Dim sMessage As String
Dim response As VbMsgBoxResult

If (objCellRange.Cells.Count < 10000) Then
Question_TakeALongTime = True
Exit Function
End If
sMessage = "You have selected " & Format(objCellRange.Cells.Count, "#,##0") & " cells to format." & _
vbNewLine & _
"The action may take more than 1 minute!" & _
vbNewLine & vbNewLine & _
"Are you sure you want to continue?"
response = MsgBox(sMessage, vbYesNo + vbDefaultButton2 + vbQuestion, "title"& " - Format Table")
Question_TakeALongTime = response
End Function

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top