I have this code which I use for selecting key sheets in a workbook and have adapted many functions off of it but for some reason I cannot get this one specific (simple) function to work.
I need to autoFit the entire contents of each selected sheet. Currently I am using the below code. It works fine for the first selected sheet in the array but when I go to check the second and third sheets the data is not autoFit. I have tried a lot of stuff, but the fact is that I dont know enough to troubleshoot this one. Pleaase Hellllp!... Its probably somthing stupid like a missing comma or declaration.
Argh..!
Thx - Tw33k
I need to autoFit the entire contents of each selected sheet. Currently I am using the below code. It works fine for the first selected sheet in the array but when I go to check the second and third sheets the data is not autoFit. I have tried a lot of stuff, but the fact is that I dont know enough to troubleshoot this one. Pleaase Hellllp!... Its probably somthing stupid like a missing comma or declaration.
Argh..!
Thx - Tw33k
Code:
Sub autoFit()
s = ""
For Each ws In Worksheets
If ws.Name Like "!*" Then s = s & Chr(1) & ws.Name
Next ws
Sheets(Split(Mid(s, 2), Chr(1))).Select
Sheets("!Crest National").Activate
Cells.Select
Selection.Columns.autoFit
End Sub