georgecomstock
New Member
- Joined
- May 27, 2011
- Messages
- 18
I thought that the following code would apply formatting to every sheet in the current workbook, but it seems to be applying it only to the current active sheet. Could someone please explain why and provide a solution, many thanks.
Code:
Public Sub formatold()
Dim ws As Worksheet
For Each ws In Worksheets
Range("A:af").Select
Selection.Font.Size = 8
Range("a:A").Select
Selection.NumberFormat = "dd-mmm-yyyy"
Range("p:p").Select
Selection.NumberFormat = "0.00"
Range("s:s").Select
Selection.NumberFormat = "0.00"
Range("t:t").Select
Selection.NumberFormat = "0.00"
Range("v:v").Select
Selection.NumberFormat = "0.00"
Range("y:y").Select
Selection.NumberFormat = "0.00"
Range("z:z").Select
Selection.NumberFormat = "0.00"
Range("ab:ab").Select
Selection.NumberFormat = "0.00"
Next ws
End Sub