I am a very novice VBA user.
I am making schedule worksheets for 3 different shifts. I want pages to name themselves based on data in a cell.
Using View Code on a page tab, I have this entered:
Private Sub Aut
pen()
ActiveSheet.Name = ActiveSheet.Range("IA2").Value
End Sub
When building, I tried saving this in Workbook in the Project-VBA Project window but it wouldn't run when I opened the notebook. Somehow I figured out how to save it as a module under that workbook. And it ran beautifully...every time.
Then I copied the Workbook for the other two shifts. In the Project-VBA Project window, it showed the module under each project.
Then when I tried any of the workbooks, I got Run-Time Error "1004" Application-defined or object-defined error.
I have tried saving the formula in a page, in the workbook, taking it out and reentering it. No luck...same error.
Can anyone help?
Kimberly
I am making schedule worksheets for 3 different shifts. I want pages to name themselves based on data in a cell.
Using View Code on a page tab, I have this entered:
Private Sub Aut
ActiveSheet.Name = ActiveSheet.Range("IA2").Value
End Sub
When building, I tried saving this in Workbook in the Project-VBA Project window but it wouldn't run when I opened the notebook. Somehow I figured out how to save it as a module under that workbook. And it ran beautifully...every time.
Then I copied the Workbook for the other two shifts. In the Project-VBA Project window, it showed the module under each project.
Then when I tried any of the workbooks, I got Run-Time Error "1004" Application-defined or object-defined error.
I have tried saving the formula in a page, in the workbook, taking it out and reentering it. No luck...same error.
Can anyone help?
Kimberly