View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lynn Lynn is offline
external usenet poster
 
Posts: 131
Default save file using information from a cell

I have a .xls workbook called Data Load.
I have a sheet called Macro (holding my radio buttons assigned to macros).
I have another sheet called item_mass.

I want to keep my .xls workbook as Data Load.xls.
Within the macro I wanted to move/copy the item_mass sheet and then save it
as the name in cell D3 of the Macro sheet.

'Select Sheet
Sheets("item_mass").Select
'Copy to new workbook
' Sheets("item_mass").Copy
Dim fname
With ActiveWorkbook
fname = .Worksheets("Macro").Range("D3").Value & ".csv"
..SaveAs "C:\Documents and Settings\a01760\Desktop\Data_Loads\Prod
Trans\130\fname"
End With

ActiveWindow.Close
Sheets("Macro").Select

This is not working.