I have a spreadsheet which is 64000kb which I want to use asa data base. What happens is the user opens this, input an account number andseveral lookups extract data based on that account and then the database issaved as a duplicate copy but naming it using a set file name D2 and in a setlocation A2. The sub I have is below.
Private Sub CommandButton3_Click()
Dim SaveName As String
SaveName =ActiveSheet.Range("d2").Text
ActiveWorkbook.SaveAs Filename:=ActiveSheet.Range("A2") &_
SaveName& ".xlsb"
End Sub
Obviously the file size is an issue and I need a Macro thatreduces the file size dramatically but after googling various answers I cantget what I need.
My workbook has 8 sheets in it but most of this is thedatabase.
What I want it to do when saving is save sheet 1 (labelled form)and sheet 4 (labelled import), all the other 6 sheets I no longer need andcan be deleted.
I want sheets 1 and 4 to lock down the data (no longer needany formulas or macros) but do want to keep it formatted and looking the sameas the original on the surface. The other issue is that I have a range in sheet4 labelled data and need that range to remain labelled as such within the newsmaller saved file as I have another database that looks for that range name toimport data from.
Thanks for your help
Private Sub CommandButton3_Click()
Dim SaveName As String
SaveName =ActiveSheet.Range("d2").Text
ActiveWorkbook.SaveAs Filename:=ActiveSheet.Range("A2") &_
SaveName& ".xlsb"
End Sub
Obviously the file size is an issue and I need a Macro thatreduces the file size dramatically but after googling various answers I cantget what I need.
My workbook has 8 sheets in it but most of this is thedatabase.
What I want it to do when saving is save sheet 1 (labelled form)and sheet 4 (labelled import), all the other 6 sheets I no longer need andcan be deleted.
I want sheets 1 and 4 to lock down the data (no longer needany formulas or macros) but do want to keep it formatted and looking the sameas the original on the surface. The other issue is that I have a range in sheet4 labelled data and need that range to remain labelled as such within the newsmaller saved file as I have another database that looks for that range name toimport data from.
Thanks for your help