ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   save worksheet as per the active cell (https://www.excelbanter.com/excel-programming/410857-save-worksheet-per-active-cell.html)

Ranjit kurian

save worksheet as per the active cell
 
Hi

i need a macro to save my excel file as per the activecell name

example: if my active cell is "A1" and in A1 i have typed a word called as
John, so the same workbook need to be saved in John's name to my C: drive.

Ron de Bruin

save worksheet as per the active cell
 
For Excel 97-2003 try something like this
It will replace the file each time you run the code

Sub test()
If ActiveCell.Value < "" Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\" & ActiveCell.Value & ".xls"
Application.DisplayAlerts = True
End If
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ranjit kurian" wrote in message ...
Hi

i need a macro to save my excel file as per the activecell name

example: if my active cell is "A1" and in A1 i have typed a word called as
John, so the same workbook need to be saved in John's name to my C: drive.



Don Guillett

save worksheet as per the active cell
 
try

Sub saveasa1()
mypath = "c:\yourfoldernamehere\"
myname = Range("a1").Value
ActiveWorkbook.SaveAs Filename:=mypath & myname & ".xls"
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ranjit kurian" wrote in message
...
Hi

i need a macro to save my excel file as per the activecell name

example: if my active cell is "A1" and in A1 i have typed a word called as
John, so the same workbook need to be saved in John's name to my C: drive.




All times are GMT +1. The time now is 05:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com