Hey everyone,
First time poster here, hope I'm doing the right thing.
I'm attempting to do the following:
Create two variables myMonthb and myMonthe, which will be used as =Weekday(myMonthb + day + myMonthe). The macro will get the day number from the column to the right of the active cell, and insert it as =Weekday(myMonthb/day/MyMonthe) - the problem I am having is that when I attempt to reference the variables myMonthb and myMonthe in the statement, I get a debug error. I am referencing them in the following way:
ActiveCell.FormulaR1C1 = "=CHOOSE(WEEKDAY(myMonthb & RC[1] & myMonthe), ""Sunday"", ""Monday"", ""Tuesday"", ""Wednesday"", ""Thursday"", ""Friday"", ""Saturday"")"
If I simply add the month and date in (as in the code below), the macro works fine.
Dim myMonthb, myMonthe As String
myMonthb = "5/1"
myMonthe = "/2008"
Do
ActiveCell.FormulaR1C1 = "=CHOOSE(WEEKDAY(""5/"" & RC[1] & ""/2008""), ""Sunday"", ""Monday"", ""Tuesday"", ""Wednesday"", ""Thursday"", ""Friday"", ""Saturday"")"
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
Any assistance would be appreciated. Thanks.
Bookmarks