empirical_psych
New Member
- Joined
- Aug 10, 2008
- Messages
- 15
Hello all,
I'm trying to run macros in Excel 2011 (Mac) that worked fine in Excel 2004 (Mac). I have OS 10.6 on a Macbook Pro.
The line of code causing the error is:
Trial = Worksheets(Subject).Cells(I, 1).Value
Where subject is string containing numbers (e.g. 801); I is an integer and a counter in a loop that begins at 2; Trial is a string; and the contents of the referenced cell is the string "Trial001". The code is in a macro-enabled workbook, and it's acting on a tab delimited text file opened in excel with the name Subject & ".txt" and the sheet named Subject (again, a string with numbers like 801).
I've determined that there aren't extra spaces in Subject, that Subject is "801" when the error occurs and that this matches the sheet name that is displayed in the tab, and that I is indeed 2.
Any advice would be greatly appreciated.
I'm trying to run macros in Excel 2011 (Mac) that worked fine in Excel 2004 (Mac). I have OS 10.6 on a Macbook Pro.
The line of code causing the error is:
Trial = Worksheets(Subject).Cells(I, 1).Value
Where subject is string containing numbers (e.g. 801); I is an integer and a counter in a loop that begins at 2; Trial is a string; and the contents of the referenced cell is the string "Trial001". The code is in a macro-enabled workbook, and it's acting on a tab delimited text file opened in excel with the name Subject & ".txt" and the sheet named Subject (again, a string with numbers like 801).
I've determined that there aren't extra spaces in Subject, that Subject is "801" when the error occurs and that this matches the sheet name that is displayed in the tab, and that I is indeed 2.
Any advice would be greatly appreciated.