LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Resizing list boxes in a form

Below a section of code from the Initialise section of a
form.

The intention is to resize the list box containing Hidden
Sheet names to accomodate the sheet name.

This works fine when stepped through, but fails when the
run normally, though the Form itsself resizes as expected.

It is part of a larger routine that was originally set to
look for hidden rows or columns to unhide selectively

Can anyone shed any light on why this might only work as
expected when stepped through?

With Me
For Each c In a
If Not c.Visible Then
Xists = True
.lstColLtrs.AddItem c.Name
If .lstColLtrs.Width = 0 Then
.lstColLtrs.Width = Len(c.Name) * .lstColLtrs.Font.Size
Else
tmp = .lstColLtrs.Width
If Len(c.Name) * .lstColLtrs.Font.Size tmp Then _
.lstColLtrs.Width = Len(c.Name) * .lstColLtrs.Font.Size
End If
End If
Next c
.Caption = "Hidden Sheets"
.btnShowCols.Caption = "Show Selected Sheets"
.Width = .lstColLtrs.Width + 42
End With

Using Excel 97 at present.

Thanks in advance for any suggestions
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
Comments boxes resizing HeatherBelle Excel Discussion (Misc queries) 3 December 2nd 08 06:29 PM
Resizing "comments" boxes in a workbook all at once rita Excel Discussion (Misc queries) 2 February 18th 05 01:41 AM
Resizing comment boxes Ian Coates Excel Programming 1 February 11th 04 07:31 PM
resizing an image on a form Liam[_2_] Excel Programming 1 November 14th 03 10:06 PM


All times are GMT +1. The time now is 06:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"