Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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.


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
How do I save only active worksheet without save all of worksheet droth Excel Worksheet Functions 2 February 21st 09 05:11 PM
active cell address with worksheet function Stefi Excel Worksheet Functions 3 November 26th 07 03:23 PM
Active cell as a reference to open a worksheet LaDdIe Excel Worksheet Functions 6 March 15th 07 07:06 PM
Active cell, row, column, worksheet, etc sip8316 Excel Programming 2 June 6th 05 02:29 PM
Save active worksheet to CSV file Scott Excel Programming 3 September 24th 03 04:51 PM


All times are GMT +1. The time now is 12:27 AM.

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"