vba write to the windows registry code example
Example: excel vba write to the windows registry
'VBA function to WRITE to the Windows Registry:
Public Sub RegSave(Key$, valType$, Val$)
With CreateObject("wscript.shell")
.RegWrite Key, Val, valType
End With
End Sub
'NB: Always backup the Windows Registry before accessing it!