lkirke
asked on
Format Worksheets via VBA Array
Hello Experts,
Have the following code, but it is not working as I anticipated. Probably missed something obvious. Any thoughts?
Regards
LK
Have the following code, but it is not working as I anticipated. Probably missed something obvious. Any thoughts?
Regards
LK
Sub Format_Sheet()
Dim ws As Worksheet
For Each ws In sheets(Array "Sheet1", "Sheet2", "Sheet3"))
ws.Select
'Formats entire worksheet with Courier New font
Cells.Select
With Selection.Font
.Name = "Courier New"
.Size = 9
ActiveWindow.Zoom = 90
Next ws
End Sub
For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))
use this code
Sub Format_Sheet()
Dim ws As Worksheet
For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))
ws.Select
'Formats entire worksheet with Courier New font
Cells.Select
With Selection.Font
.Name = "Courier New"
.Size = 9
End With
ActiveWindow.Zoom = 90
Next ws
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Experts for the prompt reponse. :)
hi Lk,
Thanks for the points but I don't think I deserve them all. After all, I only changed 3-4 lines of Ssaqibh's working code...
Rob
Thanks for the points but I don't think I deserve them all. After all, I only changed 3-4 lines of Ssaqibh's working code...
Rob