I am getting very frustrated with this. This is a subset of some code I am working on.
Sub testmacro()
myDataBook = ActiveWorkbook.Name
myDataSheet = ActiveSheet.Name
myRows = 12
y = Workbooks(myDataBook).Sheets(myDataSheet).Range("A1", Cells(myRows, 1)).Address
Workbooks.Add
y = Workbooks(myDataBook).Sheets(myDataSheet).Range("A1", Cells(myRows, 1)).Address
End Sub
The first line y= works fine.
the second line y= fails. Why why why? What does workbooks.add do to stuff up this line of code? Can anyone help me?
Matt
Bookmarks