What do you want to save?
Add Code snippet
New code examples in category VBA
-
Babbzzz 2021-09-12 18:21:03
excelvba load csv file into an array rather than the worksheet
'VBA function to open a CSV file in memory and parse it to a 2D 'array without ever touching a worksheet: Function ArrayFromCSV(sFile$) Dim c&, i&, j&, p&, d$, s$, rows&, cols&, a, r, v Const Q = """", ... Add solution -
Koyae 2021-09-12 15:55:03
get unique random number in vb.net
Dim numbers = Enumerable.Range(0, 11).ToList() Dim RandomClass As New Random() Dim RandomIndex As Integer For counter As Integer = 1 To 5 RandomIndex = RandomClass.Next(0, numbers.Count) MsgBox(numbers(RandomIndex)) numbers.RemoveAt(RandomInde... Add solution -
Edgarator 2021-09-12 14:14:02
excel vba unlock sheet without password
Sub PasswordBreaker() 'Breaks worksheet password protection. Dim i As Integer, j As Integer, k As Integer Dim l As Integer, m As Integer, n As Integer Dim i1 As Integer, i2 As Integer, i3 As Integer Dim i4 As Integer, i5 As Integer, i6 As Integer On Err... Add solution -
Londonbus 2021-09-11 13:10:02
vba copy file
' Reference needed: "Microsoft Scripting Runtime" Dim fso As Object Set fso = VBA.CreateObject("Scripting.FileSystemObject") fso.CopyFile(source, destination[, overwrite] ) ' Or: overrides a non opened file: FileCopy source, destination Add solution -
Tatiana 2021-09-11 09:21:02
vb.net get string between two strings
Public Function GetStringBetween(ByVal InputText As String, ByVal starttext As String, ByVal endtext As String) Dim startPos As Integer Dim endPos As Integer Dim lenStart As Integer startPos = InputText.IndexOf(starttext, StringComparison.CurrentC... Add solution -
Dieter Menne 2021-09-11 07:16:03
excel vba convert number to binary string
'VBA function to convert number to binary string: Function DecToBin$(ByVal n&) Do DecToBin = n Mod 2 & DecToBin n = n \ 2 Loop While n End Function '------------------------------------------------------------------- 'N... Add solution -
Marflar 2021-09-11 04:31:02
excel vba check if a string contains another string
'Use VBA's InStr() function to check 'if a string contains another: MsgBox InStr("Excel Hero", "Hero") 'Displays: 7 MsgBox InStr("Excel Hero", "hero") 'Displays: 0 MsgBox InStr("Excel Hero", "hero&... Add solution -
Mathana Sreedaran 2021-09-10 23:06:02
excel vba query database
'VBA function to query an Access database. Returns and ADO recordset: Function QuerySQL(sql$, dbFile$) Dim cnx Set cnx = CreateObject("ADODB.Connection") cnx.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & dbFi... Add solution
Best helpers
Wo0dy
+5
Jim Pinnells
+5
Spookylukey
+5
Des Wilson
+5
Chris
+5
Ignatz
+5
Gaz
+5
Jo Boiardi
+5
Nthntn
+5
Jonny Five
+5
Asya Saryan
+5
Tralston
+5
Jeff Roe
+5
Hellybaby G
+5
SGoins
+5
Cbeleites
+5