• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

how to minimize user form

sairam

New Member
Hi There,


Kindly suggest me how to minimize user form to use other excel files


i tried userform.show vbmodeless


even am notable to minimize the userform but i can use other excel files


Please help me to come out
 
Hi, sairam!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point -which you've yet walked through- I'd recommend you to read the green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about questions in general...


If you haven't performed yet the search herein, try going to the topmost right zone of this page (Custom Search), type the keywords used in Tags field when creating the topic or other proper words and press Search button. You'd retrieve many links from this website, like the following one(s) -if any posted below-, maybe you find useful information and even the solution. If not please advise so as people who read it could get back to you as soon as possible.


And about this question in particular...


It's not easy at all but possible, even not recommended if you're a VBA beginner. Check this link:

http://www.mrexcel.com/forum/excel-questions/486741-minimize-userform-using-visual-basic-applications-code.html


Regards!
 
@Sairam


Hi


Please try the below Code


in a normal module paste the below code

[pre]
Code:
'Place this code in a Module

Private Declare Function FindWindowA Lib "USER32" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLongA Lib "USER32" _
(ByVal hWnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLongA Lib "USER32" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Option Explicit

Sub FormatUserForm(UserFormCaption As String)

Dim hWnd            As Long
Dim exLong          As Long

hWnd = FindWindowA(vbNullString, UserFormCaption)
exLong = GetWindowLongA(hWnd, -16)
If (exLong And &H20000) = 0 Then
SetWindowLongA hWnd, -16, exLong Or &H20000
Else
End If

End Sub

Sub ShowForm()

UserForm1.Show vbModeless

End Sub

In the UserForm paste the below code


Private Sub UserForm_Initialize()

Call FormatUserForm(Me.Caption)

End Sub
[/pre]
Hope it is solve your problem


Thanks


SP
 
Back
Top