Get to the trust centre settings
Note: if you are missing the developer tab, add it: Go back to options as described above, select customize ribbon and add the developer option to the ribbon.
Rename it
Function bracket(stin As String, Optional brk1 As String = "(", Optional brk2 As String = ")") As String bracket = brk1 & stin & brk2 End Function Function quote(Optional stin As Variant = "") As String quote = bracket(CStr(stin), """", """") End Function Function afConc(arr() As Variant) As String Dim i As Long, s As String s = "" For i = LBound(arr) To UBound(arr) If Len((arr(i, 1))) > 0 Then s = s & arr(i, 1) & "|" End If Next i afConc = s End Function Function howmanyInList(inThisList As Range) As Long Dim r As Range Dim Count As Long Count = 0 For Each r In inThisList If IsEmpty(r.Value) Then Exit For End If Count = Count + 1 Next r howmanyInList = Count Set r = Nothing End Function
Use them
I hope this can get you started in VBA. You’ll find it an interesting world. Why not head over to Get Started Snippets and join our forum for questions, feedback and comments.
bruce mcpherson is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.mcpher.com. Permissions beyond the scope of this license may be available at code use guidelines