LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Why Won't This Macro Work?

The following macro is installed in "This Workbook." All it needs to do is
identify the user's OS. If the OS is a Mac, the window maximizes and positons
itself in a certain way. If the OS is Windows (or any non-Mac OS), it should
position the window similarly, but then also cycle through each sheet and set
the font characteristics as shown. The macro works fine when I just run it,
but, even though it's in "This Workbook" and setup as an Open event, it
doesn't do anything on a PC--it doesn't error out, it just doesn't do
anything. The macro DOES position the window correctly on a Mac, but again,
on a PC, nothing happens at all. In particular, I really need the font to set
to 8 on a PC (but not on a Mac). Does anyone have any ideas? (If I can get it
to work, my ultimate plan is to modify the Mac part to rescale the font to
10, but that's assuming I can get the rest of it to go in the first place.)

Private Sub Workbook_Open()
If Application.OperatingSystem Like "*Mac*" Then
ActiveWindow.Zoom = 100
With ActiveWindow
.Top = 1
.Left = 1
.Height = Application.UsableHeight
.Width = Application.UsableWidth
End With
Else
With ActiveWindow
.WindowState = xlNormal
.Top = 1
.Left = 1
.Height = Application.UsableHeight
.Width = Application.UsableWidth
End With
Dim S As Worksheet
For Each S In ActiveWorkbook.Worksheets
Cells.Select
With Selection.Font
.Name = "Verdana"
.Size = 8
End With
Next
Sheets(1).Activate
End If
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get a macro to work Danny Excel Discussion (Misc queries) 8 August 20th 07 01:30 PM
macro for work book Daniel Charts and Charting in Excel 1 August 12th 07 12:04 AM
Macro will work on one computer but not on another Gillian Excel Worksheet Functions 11 June 15th 07 08:57 PM
Why does the macro not work? Xanadude Excel Worksheet Functions 4 April 24th 05 09:06 PM
how do you get (end down) to work in a macro? lcx2 Excel Worksheet Functions 1 March 24th 05 08:15 AM


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"