Thread: Unselect Cells
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Unselect Cells

typo:

ActiveSheet.Copy
With ActiveWorkbook
.Sheets(1).Cells.Copy
.Sheets(1).Cells.PasteSpecial (xlPasteValues)
.Sheets(1).Range("A1").Select
.SaveAs FileName
.Close
End With

or

ActiveSheet.Copy
With ActiveWorkbook.sheets(1)
.Cells.Copy
.Cells.PasteSpecial (xlPasteValues)
.Range("A1").Select
.Parent.SaveAs FileName
.Parent.Close SaveChanges:=False
End With

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy



"Tom Ogilvy" wrote:

Dim FileName As String
FileName = "C:\test5\" & Range("C105") & " " & Range("f105")

ActiveSheet.Copy
With ActiveWorkbook
.Sheets(1).Cells.Copy
.Sheets(1).Cells.PasteSpecial (xlPasteValues)
.Range("A1").Select
.SaveAs FileName
.Close
End With

--
Regards,
Tom Ogilvy


"bobwilson" wrote:


I need to unselect the cells in the new worksheet (in new workbook) that
I'm creating.

I can't seem to figure out how to unselect the cells from the new
worksheet file that I'm creating. This is the part of my macro that
creates a separate copy of my current activesheet. The Problem is when
the Macro creates the new sheet it leaves all the cells selected so
when I open the file again they are all selected. How do I unselect the
sheet prior to the sheet saving?

Dim FileName As String
FileName = "C:\test5\" & Range("C105") & " " & Range("f105")

ActiveSheet.Copy
With ActiveWorkbook
.Sheets(1).Cells.Copy
.Sheets(1).Cells.PasteSpecial (xlPasteValues)
.SaveAs FileName
.Close
End With


--
bobwilson
------------------------------------------------------------------------
bobwilson's Profile: http://www.excelforum.com/member.php...o&userid=33046
View this thread: http://www.excelforum.com/showthread...hreadid=529212