Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Many thanks to Ron for the help he has already given me with this project, however I am copying a worksheet template to a different folder and cant get the columns to size correctly. The code I am using I have listed below.....is it obvious what I am doing wrong? Private Sub CommandButton4_Click() Dim wipnum As String Dim na As String ActiveSheet.Range("B2:H42").Select Selection.Copy Workbooks.Add na = ActiveWorkbook.Name ActiveSheet.Range("B2").Select ActiveSheet.Paste Application.CutCopyMode = False ActiveWindow.Zoom = 75 Columns("B:B").ColumnWidth = 12.86 Columns("E:E").ColumnWidth = 12.86 Columns("D:D").ColumnWidth = 12.86 Columns("c:c").ColumnWidth = 12.86 Columns("G:G").ColumnWidth = 12.86 Columns("H:H").ColumnWidth = 12.86 Columns("F:F").ColumnWidth = 12.86 wipnum = Range("C2") Windows("ESTIMA2.XLS").Activate ActiveSheet.Range("O5").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Range("C2").Select Windows(na).Activate ActiveSheet.Range("O5").Select ActiveSheet.Paste ActiveSheet.Range("C2").Select ActiveWorkbook.SaveAs Filename:="G:\Docs\ESTTRI\" & wipnum & ".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False Windows("ESTIMA2.XLS").Activate ActiveSheet.Range("a1").Select MsgBox "File saved as " & wipnum & ".xls", vbOKOnly, "File Saved Sucessfully" End Sub I am a complete novice with VBA and the code you see above I have had a lot of help from various people to get this far. So if you could keep any answer as simple as possible I would appreciate it. Regards Nigel -- Nigel ------------------------------------------------------------------------ Nigel's Profile: http://www.excelforum.com/member.php...o&userid=25696 View this thread: http://www.excelforum.com/showthread...hreadid=474803 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copied formula produces unexpected copied results | New Users to Excel | |||
Name Box sizing | Excel Discussion (Misc queries) | |||
Row Sizing | Excel Discussion (Misc queries) | |||
sizing columns in code | Excel Programming | |||
Why my cell format is not copied when I copied workbook? | Excel Programming |