Results 1 to 3 of 3

ListObjects

Threaded View

  1. #1
    Registered User
    Join Date
    11-14-2008
    Location
    Tampa
    MS-Off Ver
    Professional Plus 2007
    Posts
    30

    ListObjects

    I wrote some code that with the click of a button called "FILTER" it converts several ranges into independent ListObjects with this code:
    Ows.ListObjects.Add(xlSrcRange, MyRange.Offset(0, 0), , xlYes).Name = "a"
    Ows.ListObjects.Add(xlSrcRange, MyRange.Offset(0, 0), , xlYes).Name = "b"
    and then automatically filters out zeros and blanks based on data from one column called "Qty" using this code:
    Ows.ListObjects("a").TableStyle = ""
    Ows.ListObjects("a").Range.AutoFilter field:=2, Criteria1:=">0", Operator:=xlAnd
    Then with the click of another button, I reset the ListObject back to a range with this code:
    Ows.ListObjects("a").Unlist
    Ows.ListObjects("b").Unlist
    The above works fabulously. Here's the problem.

    I have quite a few columns in the table and I wish to print everything out on one sheet. That's easy enough. I just format several column widths to equal 8. The problem comes in, when the range turns into a ListObject, these columns widen to fit the text in the column headers. I set the cell format for "wrap text", but that doesn't cure it. How do I keep the column width from widening after converting a range into a ListObject?
    Last edited by Leith Ross; 04-24-2009 at 11:42 AM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1