Saving spreadsheet based on cell information

proof

Board Regular
Joined
Nov 18, 2005
Messages
53
I have a manual order form which I use to take customer orders, and I would like to be able to save the file soley based on the customers name which resides in a single cell.

In otherwords, cell C1 contains the name John Smith, so when I hit save, it automatically saves the file names as John Smith.xls

Is this possible? If not, that would be a nice feature for Microsoft to add, in my humble opinion.

Thanks for reading.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Welcome to the Board!

It's absolutely possible:

<font face=tahoma><SPAN style="color:#00007F">Sub</SPAN> NewSave()
    ActiveWorkbook.SaveAs ActiveWorkbook.Path & Range("C1") & ".xls"
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

To use it, hit ALT+F11 to open the VBE (Visual Basic Editor), then goto Insert-->Module. Paste the code in the module window that opens on the right. Then exit back to Excel (ALT+Q).

You can then draw a Button from the Forms toolbar and once drawn, when the "Assign Macro" dialog comes up, select "NewSave".

Hope that helps,

Smitty
 
Upvote 0
I did not design this spreadsheet, but the cell is actully R7C5.

What would be the code for that.

I assume it means Row 7 cell 5, but I tried inserting that inplace of C5 and it didn't work.

Thanks for the help.
 
Upvote 0
C5 would be Cells(5,3). R7C5 is E7.

To add the directory and Path, replace ActiveWorkbook.Path with the dir & path. Like "C:\Documents and Settings\Desktop"...

Smitty
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,776
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top