Originally Posted by
p45cal
so your other solution passing the userform might work with .StartUpPosition set to 0
You may have to change the top line of:
[vba]Sub SetDlgPosByObject(ByRef uf As UserForm)
uf.Left = 31
uf.Top = 51
End Sub
[/vba] to:
Sub SetDlgPosByObject(ByRef uf)
or just:
Sub SetDlgPosByObject(uf)
perhaps because (and I'm not sure of my ground here) it should strictly be
[vba]Sub SetDlgPosByObject(ByRef uf As UserForm1)
uf.Left = 31
uf.Top = 51
End Sub[/vba](which worked here) A stab in the dark: is this because Userform1 is a class itself?
To make it work for more than one userform just miss out the As xxxx.
You'll still have to set .startupposition to Manual (that's 0) somewhere.