View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default Save just a worksheet from a workbook

Maybe when the user clicks a command button to save (or in the
Workbook_BeforeClose event) you can delete all the other sheets and save the
workbook with a new name.

Dim Sheet As Worksheet

For Each Sheet In ActiveWorkbook
If Sheet.Name < "Form" Then Sheet.Delete
Next Sheet

ActiveWorkbook.SaveAs "C:\NewWorkbook.xls"


"BigPig" wrote:

Is it possible to save just a worksheet out of a workbook that is quite large?

Example: I have a user form that extracts data from a worksheet labeled
'data', and with a command button inputs the data into another worksheet
labeled 'form' in the same workbook. The userform also allows the user to
change the information on the user form if it is incorrect, and then with the
command button populate the appropriate fields on the form (worksheet
formatted to look like a commonly used form).

Since the workbook's size is upwards of 1 meg, and each applicant would have
to be saved, I thought the best way would be to save just the form with the
data put into it. I have tried several different ways via this website and
others, but I am a novice vba user.

Please help! Thankyou.