View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default What is the VBA for the Excel 2007 "Switch Window" command button?

sub pickup()
n = Windows.Count
s = "Pick From:"
For i = 1 To n
s = s & Chr(10) & Windows(i).Caption
Next
t = Application.InputBox(prompt:=s, Type:=2)
Windows(t).Activate
End Sub

this should work in 2007 or prior versions.
--
Gary''s Student - gsnu200836


"ND Pard" wrote:

In Excel 2007, on the View tab, in the Window section, is a Switch Windows
button.

I would like to replicate that feature via VBA. Ie, during a subprocedure
run, I would like it to display the open workbooks and allow the user to
click on one of the results to activate that workbook.

What is the VBA for the Excel 2007 "Switch Window" command button?

Thanks in advance.