+ Reply to Thread
Results 1 to 4 of 4

Why autoformat increases file size?

  1. #1
    kdw
    Guest

    Why autoformat increases file size?

    I have a very small range of data (10 columns and about 100 rows) to export
    to Excel. If I use AutoFormat like wkbk.range("A:I").AutoFormat, then the
    file size is 3MB+, but if I leave out this line, then the size is only about
    17k. Anyone knows why? I can get what I need using othe methods like
    NumberFormat, but just curious to the why.

    Thanks!

  2. #2
    keepITcool
    Guest

    Re: Why autoformat increases file size?



    if you use autoformat on the range A:H
    then all cells in those columns are formatted..
    from row 1 to 65536...

    since the used range depends on formatting as well as content...
    you now have a large usedrange.. and thus a large file size.

    first:
    clear the formatting on row 65536
    then delete rows 101:65536
    then save the file.

    it "should" now be ok again.

    and next time..
    activesheet.usedrange.autoformat






    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    kdw wrote :

    > I have a very small range of data (10 columns and about 100 rows) to
    > export to Excel. If I use AutoFormat like
    > wkbk.range("A:I").AutoFormat, then the file size is 3MB+, but if I
    > leave out this line, then the size is only about 17k. Anyone knows
    > why? I can get what I need using othe methods like NumberFormat, but
    > just curious to the why.
    >
    > Thanks!


  3. #3
    Tushar Mehta
    Guest

    Re: Why autoformat increases file size?

    Assuming you have a variable named aWS that refers to the *worksheet*
    of interest, consider the untested
    Application.Intersect( _
    aws.Range("A:i"), aws.UsedRange).AutoFormat

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <[email protected]>,
    [email protected] says...
    > I have a very small range of data (10 columns and about 100 rows) to export
    > to Excel. If I use AutoFormat like wkbk.range("A:I").AutoFormat, then the
    > file size is 3MB+, but if I leave out this line, then the size is only about
    > 17k. Anyone knows why? I can get what I need using othe methods like
    > NumberFormat, but just curious to the why.
    >
    > Thanks!
    >


  4. #4
    kdw
    Guest

    Re: Why autoformat increases file size?

    Thank you. I have not worked much with UsedRange before, but will now pay
    closed attention.

    "keepITcool" wrote:

    >
    >
    > if you use autoformat on the range A:H
    > then all cells in those columns are formatted..
    > from row 1 to 65536...
    >
    > since the used range depends on formatting as well as content...
    > you now have a large usedrange.. and thus a large file size.
    >
    > first:
    > clear the formatting on row 65536
    > then delete rows 101:65536
    > then save the file.
    >
    > it "should" now be ok again.
    >
    > and next time..
    > activesheet.usedrange.autoformat
    >
    >
    >
    >
    >
    >
    > --
    > keepITcool
    > | www.XLsupport.com | keepITcool chello nl | amsterdam
    >
    >
    > kdw wrote :
    >
    > > I have a very small range of data (10 columns and about 100 rows) to
    > > export to Excel. If I use AutoFormat like
    > > wkbk.range("A:I").AutoFormat, then the file size is 3MB+, but if I
    > > leave out this line, then the size is only about 17k. Anyone knows
    > > why? I can get what I need using othe methods like NumberFormat, but
    > > just curious to the why.
    > >
    > > Thanks!

    >


+ Reply to Thread

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