VBA - Visual Basic for Applications
If you have to change the sort order of data returned in a RecordSet to behave case sensitive in VBA you can use a trick, which is provided by Microsoft.
Source Code
The below function returns a hexadecimal representation of a handed String, which can then be used in an ORDER BY clause of a sequel statement.
Example
References
Original Source is available at following URL.
https://support.office.com/en-us/article/Sort-records-in-case-sensitive-order-8fea1de4-6189-40e7-9359-00cd7d7845c0
- Hits: 9386
The below snippet will provide you with a systems full user name.
Source Code
' @Author - Alexander Bolte
' @ChangeDate - 2014-10-13
' @Description - Returning the system user name.
Public Function getFullUserName() As String
Dim WSHnet As Object
Dim UserFullName As String
Dim userName As String
Dim UserDomain As String
Dim objUser As Object
Set WSHnet = CreateObject("WScript.Network")
userName = WSHnet.userName
UserDomain = WSHnet.UserDomain
Set objUser = GetObject("WinNT://" & UserDomain & "/" & userName & ",user")
UserFullName = objUser.FullName
Set WSHnet = Nothing
Set objUser = Nothing
getFullUserName = UserFullName
End Function
Referenced APIs
Since the source is using late binding it is not necessary to set a reference in the VBA Editor for a specific version of the referenced API named "WScript".
- Hits: 9247
Below method allows you to remove the shadow from all shapes of the same type (arrow, rectangle, ... ) at once, instead of selecting each shape manually.
If you want to apply more formats than only removing a shadow, then use the methods PickUp and Apply of the Shape object.
PickUp copies the format of one Shape object and Apply copies a before picked up format.
Source Code
- Hits: 9297
Subcategories
Excel VBA Article Count: 30
This category will hold articles regarding developement in Excel VBA. It will serve as a wiki and an Excel VBA Framework for myself.
Some development tasks reoccur for every customer. Since I am a lazy bum it will be nice to have a central source where I can reuse source code from.
MS Office and VBA Article Count: 11
This category holds articles regarding general things in MS Office VBA independent from the MS Office application.
Power Point VBA Article Count: 1
Access VBA Article Count: 7
This category holds articles regarding Access VBA, but also general things I come accross Access and its usage in companies.
Access VBA DAO Article Count: 2
Page 4 of 17