Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default save button in excel to save one of the worksheets with a cell value as its name

Hi
Just wondered if someone could help me with what I'm sure
will be an easy solution, but obviously hard if you don't
know how.

I have a spreadsheet with two worksheets, what I want to
do is have a button on the first sheet that will save the
second sheet as a seprate .xls or better still an html
page using the value of a specific cell as the name of
the file.

i.e I have two worksheets, named sheet1 and sheet2 for
example, if the value in cell A6 is 20040904 then
clicking on a button on sheet1 would save sheet2 as
20040904.html or 20040904.xls

is it possible and if so can someone please let me know
how

many thanks, Colin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default save button in excel to save one of the worksheets with a cell value as its name

Dim sStr as String
sStr = worksheets("sheet1").Range("A6").Value
worksheets("Sheet2").Copy
ActiveWorkbook.SaveAs "C:\Myfolder\" & sStr & .htm, FileFormat:=xlhtml
ActiveWorkbook.close Savechanges:=False

--
Regards,
Tom Ogilvy


"Colin" wrote in message
...
Hi
Just wondered if someone could help me with what I'm sure
will be an easy solution, but obviously hard if you don't
know how.

I have a spreadsheet with two worksheets, what I want to
do is have a button on the first sheet that will save the
second sheet as a seprate .xls or better still an html
page using the value of a specific cell as the name of
the file.

i.e I have two worksheets, named sheet1 and sheet2 for
example, if the value in cell A6 is 20040904 then
clicking on a button on sheet1 would save sheet2 as
20040904.html or 20040904.xls

is it possible and if so can someone please let me know
how

many thanks, Colin



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default save button in excel to save one of the worksheets with a cell value as its name

Hi Tom

many thanks for the reply, I'll give it a go, once again many thanks for
taking the time to respond and offering your expertise.

Colin



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
The SAVE AS button does not show save to G: drive Marilyn S New Users to Excel 5 January 17th 08 02:00 AM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
how to get disk icon on save button of save as dialog like 2000 RichT Excel Discussion (Misc queries) 2 March 9th 06 08:13 PM
save as isnt there neither is the save button pressable fernandzefruitcake Excel Discussion (Misc queries) 3 September 28th 05 04:15 PM
Can't save Excel using Save button, hainstol Excel Discussion (Misc queries) 1 May 3rd 05 02:39 PM


All times are GMT +1. The time now is 12:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"