lock userform to screen

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,056
Hi All,

Is there a way to lock a userform to the screen so that if I go from say excel to internet explorer the userform will remain on the screen so that I can see the textbox info without having to flick back and forth between programs (I only use one monitor)

Thanks
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,056
Just a note,

I want it to be like a stickynotes program where it's locks/ pins the userform to the screen no matter what you do, until you close it.
 

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,056
Hi Guys,

Thanks for your help but maybe I need to explain what I want a bit better.

If you think of a post it note or sticky note, you write on it and stick in on your screen, it stays there.

I use an application called stickynotes, basically it is a computer post it note or stickynote.
You can write on it and it remains stuck to your screen no matter what application you go into, if you go into word the note is stuck there, if you go into internet explorer it is stuck there, until you close it.

A userform can stay on the screen when you switch between excel workbooks but when you change to internet explorer you can no longer see the userform, I want to be able to see the userform even when I switch from excel to internet explorer.

I hope that this explains what I am after a bit better.
 

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,056
Are there any experts out there that can help with this, please?????
 

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,056
Chip Pearson has given me a solution for this problem.

Code:
Option Explicit
Private Declare Function SetWindowPos Lib "user32" ( _
    ByVal hwnd As Long, _
    ByVal hWndInsertAfter As Long, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal cx As Long, _
    ByVal cy As Long, _
    ByVal wFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long
Private Const HWND_TOPMOST = -1
Sub ShowTheForm()
    Dim UF As UserForm1
    Dim UFHandle As Long
    Set UF = New UserForm1
    UFHandle = FindWindow("ThunderDFrame", UF.Caption)
    SetWindowPos UFHandle, HWND_TOPMOST, UF.Left, UF.Top, UF.Width, UF.Height, 0&
    UF.Show vbModeless
End Sub

the only problem that I am having now is that I can not update the textbox controls on the form, hopefully Chip will give me a solution.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,445
Messages
5,528,801
Members
409,835
Latest member
Mafu1267

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top