
This VBA code will check your current operating systems and returns the operating system information. You can copy the code and paste it in Excel for Mac or Windows.
Get Access to Your File
Enter your name and email to receive access to the file.
- Copy the below VBA Code by clicking on the copy box
- Open Microsoft Visual Basic for Applications window Developer Ribbon Tab > Visual Basic (Shortcut keys as follows for mac & windows)
- mac users fn + ⌥ [option] + F11
- windows users Alt + F11
- From the menu bar select Insert > Module and insert new Modules
- Paste the code into the module.
Note: It is always good to take a back-up copy of your original before running the code on the original file.
Sub CheckOS() 'Made It Easy by ExcelExciting.com | Faraz Shaikh | Updated : 20200801 Dim CheckOS As String '****************************************************** 'Check the Operating system CheckOS = Application.OperatingSystem MsgBox "You are using " & CheckOS '****************************************************** End Sub
So the important part of code in the above code is “Application.OperatingSystem” checks the operating system and return the information.
Was the information helpful in this blog?
- If yes, hit that share button and show the excitement to the world.
- Subscribe to our free posts.
Join 2,922 other subscribers
If no, please let us know what to improve.
Having trouble with any Office Apps. Feel free to ask and answer queries at our forums section.
Thanks. This works great on my Mac. Since I use Mac at work and PC at home, an improvement to your article might be to show a typical result from both environments, that way I could continue to code for both results here at work, without have to port my work to my home computer to see what results I will get there. It would save me a day’s worth of time.