Macro 4.0 error: "names cannot look like references"

excelneo

New Member
Joined
Nov 15, 2010
Messages
2
Hello,

I have been using a specific excel macros 4.0 workbook for years and recently upgraded to Excel for Mac 2011 from 2004. I am using MacOS 10.6. The macros were written for me by someone more than a decade ago and he is not available now.

When I use the macro it comes back with this error message and then hangs and I have to force quit. "names cannot look like references". The following is the code where the error is kicked out, specifically in the boldface lines.

Code:
=ARGUMENT("Beginday",1)
=ARGUMENT("Endday",1)
=SET.NAME("Month1",MONTH(Beginday))
[B]=SET.NAME("Day1",DAY(Beginday))[/B]
=SET.NAME("Year1",YEAR(Beginday))
=SET.NAME("Month2",MONTH(Endday))
[B]=SET.NAME("Day2",DAY(Endday))[/B]
=SET.NAME("Year2",YEAR(Endday))
=IF(Day1=31,SET.NAME("Day1",30),)
=IF(Month1=2,IF(Day1=28,SET.NAME("Day1",30),IF(Day1=29,SET.NAME("Day1"=30),)),)
=IF(Day2=31,IF(Day1=30,SET.NAME("Day2",30),),)
=(Year2-Year1)*360+(Month2-Month1)*30+(Day2-Day1)
=RETURN(A46)

Thanks in advance for any help you may provide and my apologies for any posting errors.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi
Welcome to the board

In Excel 2011 you have now 16k columns, from A to XFD, so DAY1 and DAY2 are now cell addresses.

If you remember from excel 2004 you also could not have names like A1 because it was a cell address.

You'll have to change the names, for ex. "DAY_1"
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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