View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_842_] Simon Lloyd[_842_] is offline
external usenet poster
 
Posts: 1
Default Macro question - Need to copy data & formatting to another workboo


This should select all cells on the sheet for which it is run, i don
know whether it works as i just kind of lashed it together withou
testing it (probably because i dont really have a clue what i'
doing!), but i copied a sheet by selecting every cell and pasting th
cells like below into a newly added sheet.

Hope it gets you some way if not all the way there!

P.S you might need to add a With statement to add the sheet in th
newly opened workbook.

Regards,
Simon

Sub ShtCopy()
Cells.Select
Selection.Copy
'''OPEN THE YOUR RECEIVING WORKBOOK HERE'''
'''SELECT YOUR NEWLY OPENED WORKBOOK'''
Sheets.Add
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteColumnWidths
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveWorkbook.Save
'''SELECT YOUR ORIGINAL WORKBOOK'''
'''CLOSE YOUR RECEIVING WORKBOOK'''
End Su

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=56556