I am sure there is a very simple solution to this problem but I have had no luck in finding an answer.
Essentially, I have a macro that performs a .find function on a sheet and loops through all the cells on that sheet. An example is shown below;
For Each c In Rng
FoundValQuant = Sheets("Cans").Cells.Find(What:=c.Value, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Offset(-1, 3).Value
FoundValPrice = Sheets("Cans").Cells.Find(What:=c.Value, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Offset(-1, 1).Value
FoundValCol = Sheets("Cans").Cells.Find(What:=c.Value, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Offset(-1, 1).Interior.Color
c.Offset(0, -1).Value = FoundValQuant
c.Offset(0, 4).Value = FoundValPrice
c.Interior.Color = FoundValCol
c.Offset(0, -1).Interior.Color = FoundValCol
c.Offset(0, 1).Interior.Color = FoundValCol
c.Offset(0, 4).Interior.Color = FoundValCol
Next c
My problem is as follows. In my windows version of excel (Excel 2013) it works flawlessly. When used with a Mac version (Excel 2011) the code does not return the values from the .find command and returns the interior color as black rather than the color that it should actually find and identify.
As far as I can see, this part of the code in my workbook seems to be the only one deciding not to work so I assume that the .find command must work somewhat differently in Excel 2011.
The only thing I have done that may have an impact here is I have disabled the 'Microsoft VBScript Regular Expressions 5.5' reference through the VBE as when the workbook is opened in Excel 2011 it is listed as 'Missing' which was causing my code to error.
This wouldn't bother me too much if I hadn't spent my whole Easter weekend building a workbook for a friend who owns a Mac. So now I just need to iron out this last crease to complete my work.
Thanks in advance.
Bookmarks