You could check to see what operating system it is and have different code run for each, working through whichever problem areas specifically crop up in the Mac version. Most likely the non-excel related code. As @chrisneilson mentioned, Specifically "Scripting.FileSystemObject"
Also, as mentioned in the comments below, the lines of code that aren't acceptable will be compiled anyway and cause an error, so you will need to run the code using conditional compilation.
Basically they only COMPILE when the conditions are met, and you do this by using "#" in front of the line such as an If statement: "#If"
Modified from MSDN's: Run The Correct Macro in Windows or on the Macintosh
Sub WINorMAC()
'Test using conditional compiler constants.
#If Win32 Or Win64 Then
'Is a Windows user.
Call getfilename
#Else
'Is a Mac user so you need to test whether the product is Excel 2011 or later.
If Val(Application.Version) > 14 Then
Call My_Mac_Macro 'almost getfilename, with some replacements for Mac
End If
#End If
End Sub
Now just modify your sub getfilename() to include the conditional compiler constants. And do the opposite for the Mac version to ensure there aren't compile errors.
Sub getfilename()
#If Win32 Or Win64 Then
Dim objFSO As Object
Dim intCountRows As Integer
Application.FileDialog(msoFileDialogFolderPicker).Title = _
"Select a Path"
intResult = Application.FileDialog( _
msoFileDialogFolderPicker).Show
If intResult <> 0 Then
strpath = Application.FileDialog(msoFileDialogFolderPicker _
).SelectedItems(1)
Set objFSO = CreateObject("Scripting.FileSystemObject")
ThisWorkbook.Activate
Sheets("dropdown").Select
Range("q2").Value = strpath
End If
Dim objFolder As Object
Dim objFile As Object
Dim i As Integer
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strpath)
ThisWorkbook.Activate
Sheets("dropdown").Activate
Range("aa3:aa2000").Clear
i = 1
For Each objFile In objFolder.Files
Filename = objFile.Name
Range("aa1000").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Application.ActiveCell = Filename
Next objFile
#End If
End Sub
edit: modified answer after comments and discussion to include conditional compilers in addition to checking for the OS type.