VBA works on Windows Excel 2010 but not Mac Excel 2011

andyfleisher

New Member
Joined
May 25, 2011
Messages
4
I modified the workbook from this site,
http://www.excelhero.com/blog/2010/07/excel-partial-match-database-lookup.html
to work with data from my job and added new worksheets to search the same data in different ways. On a windows machine running Office 2010, the macros work fine and the search results are displayed.

On a Macintosh running Office 2011, I get a runtime error 424 Object Required (I think) for the line,
Code:
[filter_criteria] = .Transpose(Array(CRITERIA_HEADER, "*" & [search_string] & "*"))
where [filter_criteria] and [search_string] are defined names in the workbook and CRITERIA_HEADER is a constant in the macro.

I am not a VBA programmer in any way, which is why I was using this wonderful code but I do know that the Mac and Windows versions of Excel use slightly different versions of VBA. What I do not know is if there are shortcuts being taken with the code which work OK for Windows but maybe on the Mac, the correct syntax needs to be used. For a check, I also tried the code on an older version of Excel 2004 on the Mac and I still got an error but at the next line,
Code:
[database].AdvancedFilter xlFilterCopy, [filter_criteria], [result_target]
Which made me think that maybe the Advanced Filter was not available (but it was when I searched through the menus) or that scripting for it was not available in the older version of Excel/VBA on the Mac.

The purpose of my file is not super important and if I can't get it to work on Macintosh computers it is not a big deal but I am just curious as to why is breaking between the two Excel versions. Thanks for all the help. I get all my Excel tricks from the MrExcel podcasts, which I love.

Andy Fleisher
UC Davis Graduate School of Management
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,216,077
Messages
6,128,680
Members
449,463
Latest member
Jojomen56

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top