Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default file size after using macro to save a worksheet

Why would a worksheet that is normally 57 kb turn into 500kb after using
macros to enter data into it?

Example: I have a workbook that has a database in it, and a userform that
takes that data based on ssn's and places that specific data in appropriate
places in a spreadsheet that is made to look like a form. Then the user uses
a commmand button/macro to save the 'form' with the data in it, to a separate
folder. The new file is now 500 plus kbs.

I even went so far as to delete all the data, lines etc... and the file size
changed to 475 kb. Not a lot different.

Is there another solution to this file size dilemna?

Thankyou.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default file size after using macro to save a worksheet

Your code is probably initializing cells that end up by not being used. They
have the overhad of any other cell, they just happen to be blank. This is
common if you hard code ranges into your macro. Take a look at the sheets
after your macro is done. Do the scroll bars allow you to move well beyond
the range of cells with values int them? If so all of the cells that you are
seeing beyond the last row and column of data need to be deleted. You are
best off to avoid creating these cells in the first place. To make the file
small again, delete (not clear contents) all of the blank rows at the bottom
and all of the blank column to the right. Now when you save your file you
should notice that it goes back to being small again...
--
HTH...

Jim Thomlinson


"BigPig" wrote:

Why would a worksheet that is normally 57 kb turn into 500kb after using
macros to enter data into it?

Example: I have a workbook that has a database in it, and a userform that
takes that data based on ssn's and places that specific data in appropriate
places in a spreadsheet that is made to look like a form. Then the user uses
a commmand button/macro to save the 'form' with the data in it, to a separate
folder. The new file is now 500 plus kbs.

I even went so far as to delete all the data, lines etc... and the file size
changed to 475 kb. Not a lot different.

Is there another solution to this file size dilemna?

Thankyou.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default file size after using macro to save a worksheet

Jim,

Thankyou for your response.

I will try and create a macro to delete all the rows and columns outside of
the worksheet made to look like a form and add that to a macro that just
saves the worksheet/form.

Some more info: In my workbook, there are 4 worksheets of which 2 are only
imporant. One is the form, the other is a database that I created by pulling
data from a sharable access database. From the form sheet the user can select
the command button that brings up a user form. The user form allows the user
to select ssn via combo box, and then other macros using index match,
extracts data from the data sheet and places the data into the appropriate
textboxes in the user form. Then if the data is correct, the user selects a
command button that enters that data into the spreadsheet 'form'. After
which another command button on the user form is used to save that specific
spreadsheet form into a file in another folder without the other sheets
associated with the workbook.

I know, sounds like a lot of extra work. The end state of this process is:
to minimize the file size, reduce time and effort looking up ssns, names and
whatnot, and reduce errors. Everthing works great, except for the file size.

I think that the problem with the file size is like you mentioned. I believe
it's the macro on the user form that indexes and matches the data from the
data sheet. I don't know for sure though.

As far as I see it, I have two options.

One, try your suggestion.

Two using a macro, take the data stored in the user form and place it in
another spreadsheet and save it for reference. Create another command
button/combobox/macro that will allow the user to retrieve data previously
used to populate the spreadsheet form in the event it has to be
accessed/referenced.

The problem with option two is that I don't know how via macro to dump that
data into another spreadsheet so that it doesn't overwrite what may have been
placed there previously via the same method. What I am asking is could you
provide an example macro that would allow me to put that data into a row, so
that subsequent applicants' data would be placed in one row down from that
etc, so that the record is kept and rows aren't overwritten.

I know I am asking a lot, so any advice would be greatly appreciated.

Thankyou again for your help.


"Jim Thomlinson" wrote:

Your code is probably initializing cells that end up by not being used. They
have the overhad of any other cell, they just happen to be blank. This is
common if you hard code ranges into your macro. Take a look at the sheets
after your macro is done. Do the scroll bars allow you to move well beyond
the range of cells with values int them? If so all of the cells that you are
seeing beyond the last row and column of data need to be deleted. You are
best off to avoid creating these cells in the first place. To make the file
small again, delete (not clear contents) all of the blank rows at the bottom
and all of the blank column to the right. Now when you save your file you
should notice that it goes back to being small again...
--
HTH...

Jim Thomlinson


"BigPig" wrote:

Why would a worksheet that is normally 57 kb turn into 500kb after using
macros to enter data into it?

Example: I have a workbook that has a database in it, and a userform that
takes that data based on ssn's and places that specific data in appropriate
places in a spreadsheet that is made to look like a form. Then the user uses
a commmand button/macro to save the 'form' with the data in it, to a separate
folder. The new file is now 500 plus kbs.

I even went so far as to delete all the data, lines etc... and the file size
changed to 475 kb. Not a lot different.

Is there another solution to this file size dilemna?

Thankyou.

Reply
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
macro save a file name from a cell in 1st worksheet karene Excel Discussion (Misc queries) 2 April 10th 06 12:13 PM
How do I set up a macro to save an Excel worksheet as a .prn file? cher Excel Programming 2 March 1st 06 03:50 PM
File size increases with each save Garbunkel[_2_] Excel Programming 0 October 5th 05 10:12 PM
Macro to export a worksheet and save as new file Mike_M Excel Programming 2 May 25th 05 10:37 AM
using macro to save worksheet with unique file name Noell Excel Programming 3 October 15th 03 10:24 PM


All times are GMT +1. The time now is 08:49 PM.

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

About Us

"It's about Microsoft Excel"