Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set focus on sheet and keep viewing vba window
Hi there Is there a way in Excel VBA to change focus from a VBA window t sheet1, programmically?? I want to be able to see the VBA window whil being able to type into sheet1 of Exce -- helmekk ----------------------------------------------------------------------- helmekki's Profile: http://www.excelforum.com/member.php...nfo&userid=693 View this thread: http://www.excelforum.com/showthread.php?threadid=39117 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set focus on sheet and keep viewing vba window
Hi,
one way: Application.VBE.CommandBars.FindControl(ID:=106).E xecute Sheet1.Activate i suppose 'Alt-F11' would be enough usually. -- HTH, okaizawa helmekki wrote: Hi there Is there a way in Excel VBA to change focus from a VBA window to sheet1, programmically?? I want to be able to see the VBA window while being able to type into sheet1 of Excel |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set focus on sheet and keep viewing vba window
Hi Helmekki,
I want to be able to see the VBA window while being able to type into sheet1 of Excel Why not simply resize the Excel and VBE windows and arrange them to suit? --- Regards, Norman "helmekki" wrote in message ... Hi there Is there a way in Excel VBA to change focus from a VBA window to sheet1, programmically?? I want to be able to see the VBA window while being able to type into sheet1 of Excel -- helmekki ------------------------------------------------------------------------ helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939 View this thread: http://www.excelforum.com/showthread...hreadid=391170 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set focus on sheet and keep viewing vba window
if you want to set the vbe window to topmost, try this:
Private Const HWND_TOPMOST = -1 Private Const HWND_NOTOPMOST = -2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOMOVE = &H2 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 Sub VBETopMost() SetWindowPos Application.VBE.MainWindow.hWnd, _ HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE End Sub Sub VBETopMost_Off() SetWindowPos Application.VBE.MainWindow.hWnd, _ HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE End Sub -- HTH, okaizawa |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set focus on sheet and keep viewing vba window
Hi Helmekki,
Something like: Sub TestIt() With Application.VBE.MainWindow .Left = 0 .Top = 0 .Width = 600 .Height = 800 .Left = 500 End With With Application .WindowState = xlNormal .Left = 0 .Top = 0 .Width = 470 .Height = 800 End With End Sub --- Regards, Norman "Norman Jones" wrote in message ... Hi Helmekki, I want to be able to see the VBA window while being able to type into sheet1 of Excel Why not simply resize the Excel and VBE windows and arrange them to suit? --- Regards, Norman "helmekki" wrote in message ... Hi there Is there a way in Excel VBA to change focus from a VBA window to sheet1, programmically?? I want to be able to see the VBA window while being able to type into sheet1 of Excel -- helmekki ------------------------------------------------------------------------ helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939 View this thread: http://www.excelforum.com/showthread...hreadid=391170 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set focus on sheet and keep viewing vba window
Thank u all, okaizawa, your code is what i need, it works very wel -- helmekk ----------------------------------------------------------------------- helmekki's Profile: http://www.excelforum.com/member.php...nfo&userid=693 View this thread: http://www.excelforum.com/showthread.php?threadid=39117 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I set a pop up window to focus? | Excel Discussion (Misc queries) | |||
how do i center the worksheet in the viewing window? | Excel Discussion (Misc queries) | |||
HELP!! Unhide Sheet with Macro and focus on other sheet | Excel Discussion (Misc queries) | |||
Focus sheet | Excel Programming | |||
keep focus & window steady | Excel Programming |