Probable No-Brainer...

I have an array representing sheets a - z (26 sheets, i=0 to 25)

the following code auto fits columns and works:

Worksheets(ArrayList(i)).Columns("A:F").EntireColumn.AutoFit

how the heck do I get it to set Font to Arial, Font-Size=8, columns C&D = $, column E (date format) dd-mm-yyyy (e.g., 19-Nov-2004)...

been at this this 4:30 AM and am getting a little "fuzzy"...

Thanks
Ron
ronaldjAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tommy KinardCommented:
I recorded some macros that may help


'Change font and size
Sub Macro1()
    Columns("C:C").Select
    With Selection.Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 8
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
End Sub
Format for currency
Sub Macro2()
    Columns("D:E").Select
    Selection.NumberFormat = "$#,##0.00"
'format for dat
    Columns("F:F").Select
    Selection.NumberFormat = "mm/dd/yy"
End Sub

HTH
dragontooth

0
ronaldjAuthor Commented:
Hey dragontooth,

Thanks for the response. I too have the same macros...when I went to try and "iterate" through the array, the font size, style, formats didn't work...my line for "Auto-fit works just fine...obviously not referencing the array correctly for the formatting...that's my problem...
Suggestion(s)?...

Ron
0
ronaldjAuthor Commented:
OK, in my battle-axe" approach to programming" this cures" part of my problem...

Worksheets(ArrayList(i)).Columns("A:F").Font.Name = "Arial"
Worksheets(ArrayList(i)).Columns("A:F").Font.Size = "8"

Hope this helps someone who experienced the same dilemna...
0
Tommy KinardCommented:
Hi ronaldj

Have you tried it this way

Worksheets(ArrayList(i)).Columns("A:F").select
 With Selection.Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 8
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
Worksheets(ArrayList(i)).Columns("C:D").select
Selection.NumberFormat = "$#,##0.00"
Worksheets(ArrayList(i)).Columns("E").select
Selection.NumberFormat = "dd/mm/yy"

HTH
dragontooth

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Theory

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.