What do you want to save?
Add Code snippet
New code examples in category VBA
-
Moha the almighty camel 2021-08-31 07:23:02
excel vba constant
' Constants are Private by default. Const MyVar = 459 ' Declare Public constant. Public Const MyString = "HELP" ' Declare Private Integer constant. Private Const MyInt As Integer = 5 ' Declare multiple constants on same line. Const ... Add solution -
SMARTDICTIONARY 2021-08-31 00:36:01
move bindingnavigator vb
BindingNavigator.Dock = DockStyle.None Add solution -
Dr H 2021-08-30 10:04:02
excel vba repeat string n times
'Fast VBA function to repeat a given string n times: Function Repeat$(ByVal n&, s$) Dim r& r = Len(s) If n < 1 Then Exit Function If r = 0 Then Exit Function If r = 1 Then Repeat = String$(n, s): Exit Function Repeat = ... Add solution -
Alex Jude 2021-08-30 10:02:01
excelvba running code from HYPERLINK() function in cell
'Execute VBA code from hyperlink on a worksheet that is the result 'of the HYPERLINK() worksheet function. 'Insert the following function in a standard code module: Function HyperlinkClick() Set HyperlinkClick = Selection 'Do whatever yo... Add solution -
Andreas Blass 2021-08-30 01:05:02
vba make integer from two bytes
Public Function MakeInteger%(LoByte As Byte, HiByte As Byte) If HiByte And &H80 Then MakeInteger = ((HiByte * &H100&) Or LoByte) Or &HFFFF0000 Else MakeInteger = (HiByte * &H100) Or LoByte End If End Function Add solution -
Alana 2021-08-29 23:57:01
vba sheets add after last
Sheets.Add Sheets.Add After:=Sheets("Input") Sheets.Add After:=Sheets(1) Sheets.Add Before:=Sheets(2) Sheets.Add.Name = "NewSheet" ' Add sheet with name Sheets.Add After:=Sheets(Sheets.Count) ' To end of Workbook Sheets.Add(B... Add solution -
Nickb 2021-08-29 20:13:01
vba static variable
' Import as a file MyStaticClass.cls: VERSION 1.0 CLASS BEGIN MultiUse = -1 'True END Attribute VB_Name = "MyStaticClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Expos... Add solution -
Elvis 2021-08-29 18:11:03
excel vba if sunday or staurday
MsgBox Weekday(my_date, vbMonday) > 5 ' Or ------------------------------------------------------- Public Function IsWeekend(InputDate As Date) As Boolean Select Case Weekday(InputDate) Case vbSaturday, vbSunday IsWeekend = True... Add solution