Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sizing of copied columns


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copied formula produces unexpected copied results Robert New Users to Excel 1 December 5th 08 04:11 PM
Name Box sizing KenInPortland Excel Discussion (Misc queries) 1 December 21st 05 08:15 PM
Row Sizing Mike@ACM Excel Discussion (Misc queries) 2 July 16th 05 04:04 AM
sizing columns in code JulieD Excel Programming 2 July 29th 04 04:29 PM
Why my cell format is not copied when I copied workbook? courtesio99[_28_] Excel Programming 0 January 9th 04 07:03 AM


All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"