bloodmilksky
Board Regular
- Joined
- Feb 3, 2016
- Messages
- 202
Hi Guys, I hope everyone is well.
I have been using the below to run copy and past information from row 8 to row a1 throughout a workbook and just to try and tidy it up I thought I would try and make everything look nice and tidy. the column and row auto fit code works fine but when i have tried to "wraptext" for all active worksheets it errors. can anyone help please?
Many thanks
jamie
Sub Treat()
Dim WS As Worksheet
For Each WS In Worksheets
If (WS.Name <> "Sheet1") Then
Sheets("Sheet1").Rows("8:8").Copy Destination:=WS.Range("A1")
WS.Select
Selection.Columns("A:A").ColumnWidth = 2.56
Selection.Columns("B:B").ColumnWidth = 10
Selection.Columns("C:C").ColumnWidth = 9.22
Selection.Columns("D:D").ColumnWidth = 20.78
Selection.Columns("E:E").ColumnWidth = 63
Selection.Columns("F:F").ColumnWidth = 46
Selection.Columns("G:G").ColumnWidth = 46
Selection.Columns("H:H").ColumnWidth = 7.11
Selection.Columns("I:I").ColumnWidth = 11.44
WS.Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
Columns.EntireColumn.AutoFit
Rows.EntireRow.AutoFit
End With
End Sub
I have been using the below to run copy and past information from row 8 to row a1 throughout a workbook and just to try and tidy it up I thought I would try and make everything look nice and tidy. the column and row auto fit code works fine but when i have tried to "wraptext" for all active worksheets it errors. can anyone help please?
Many thanks
jamie
Sub Treat()
Dim WS As Worksheet
For Each WS In Worksheets
If (WS.Name <> "Sheet1") Then
Sheets("Sheet1").Rows("8:8").Copy Destination:=WS.Range("A1")
WS.Select
Selection.Columns("A:A").ColumnWidth = 2.56
Selection.Columns("B:B").ColumnWidth = 10
Selection.Columns("C:C").ColumnWidth = 9.22
Selection.Columns("D:D").ColumnWidth = 20.78
Selection.Columns("E:E").ColumnWidth = 63
Selection.Columns("F:F").ColumnWidth = 46
Selection.Columns("G:G").ColumnWidth = 46
Selection.Columns("H:H").ColumnWidth = 7.11
Selection.Columns("I:I").ColumnWidth = 11.44
WS.Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
Columns.EntireColumn.AutoFit
Rows.EntireRow.AutoFit
End With
End Sub