View Single Post
  #23   Report Post  
Posted to microsoft.public.excel.misc
[email protected] stephen.ditchfield@gmail.com is offline
external usenet poster
 
Posts: 24
Default problems getting this macro to work

Hi Garry
that is fantastic,
worked like a charm and thank you for your time and knowledge with helping me.
It is very much appreciated and I am very slowly learning.

regards
Ditchy


On Monday, May 12, 2014 5:29:43 PM UTC+10, wrote:
Hello,

I am trying to copy a sheet, saving as a new workbook, values & number formats

also with the filename taken from (A1) all with the click of a button, sounds easy!

here is the macro



Dim myFileName As String

With ActiveWorkbook

* *worksheets(1).Copy 'to a new workbook

* with active sheet with.UsedRange.

Copy.PasteSpecial Paste:=xlPasteValues 'remove formulas??? *

'pick up the name from some cells???

*myfilename = .range("a1").value & ".xls" myfilename = "C:\Users\Ditchy\Desktop\" & myfilename *'????

.Parent.SaveAs Filename:=myFileName, FileFormat:=xlWorkbookNormal

.Parent.Close savechanges:=False

End With

End Sub



any and all help appreciated



regards

Ditchy

Ballarat

Australia