Вот код, который я использую в своих макросах (в формах):
Private nameGroup As String
Private nameFolder As String
Private Sub Class_Initialize()
nameGroup = "nameMacros"
nameFolder = "savePosition"
End Sub
Private Sub UserForm_Activate()
Me.Left = GetSetting(nameGroup, nameFolder, "left", "0")
Me.Top = GetSetting(nameGroup, nameFolder, "top", "0")
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
SaveSetting nameGroup, nameFolder, "left", Me.Left
SaveSetting nameGroup, nameFolder, "top", Me.Top
End Sub