How do I widen the Name Box Navigator in Excel?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I widen the column width of the drop down window containing the list
of cell and range names in the Name Box navigator at the top left of the
screen?
 
Colt,

Here is a routine that I think Chi[p Pearson posted originally

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

'-----------------------------------------------------------------
Public Sub WidenNameBox()
'-----------------------------------------------------------------
Dim Res As Long
Const CB_SETDROPPEDWIDTH = &H160
Const cWidth = 200

Res = SendMessage( _
FindWindowEx( _
FindWindowEx( _
FindWindow("XLMAIN", Application.Caption) _
, 0, "EXCEL;", vbNullString) _
, 0, "combobox", vbNullString), _
CB_SETDROPPEDWIDTH, cWidth, 0)
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top