View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Capo[_3_] Capo[_3_] is offline
external usenet poster
 
Posts: 1
Default Select method of Range class failed


Okay, so after a few tweaks, I got the main chunks working!! :D Here is
the updated code:


Code:
--------------------
Private Sub cmdSave_Click()
Dim SavePath As String
Dim SaveFile As String
Dim BookName As String

BookName = "test.xls"
Range("A1:G47").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues
Selection.PasteSpecial Paste:=xlPasteFormats

Sheets(Array("Sheet2", "Sheet3")).Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet1").Name = "Procedures"

Columns("A:G").EntireColumn.AutoFit

SavePath = "N:\Procedures\Customer Info\"
SaveFile = Range("G1")
ActiveWorkbook.SaveAs (SavePath & SaveFile & ".xls")
ActiveWindow.Close
Sheets("Customer").Select
Sheets("Customer").Range( _
"B1,B2,B3,B5,B6,B7,B8,B13,B14,B15,B16,B19,B20,B21, G1,G3,I5,I6,I7,I8,I9,G13,G15,G17,G19" _
).Select
Selection.ClearContents
Sheets("Procedure").Select
Range("A1").Select

End Sub

--------------------


However, in the saved file, the columns aren't autofit like I had tried
to do with the following line:

Columns("A:G").EntireColumn.AutoFit

Any suggestions there??


--
Capo
------------------------------------------------------------------------
Capo's Profile: http://www.excelforum.com/member.php...o&userid=37283
View this thread: http://www.excelforum.com/showthread...hreadid=569904