Hi could someone let me know how to resolve a VBA problem thats just occured after I renamed a worksheet.
So I had a sheet named 'DataTest' (in Excel) and 'shData' in the VBA Objects. (The 'DataTest' sheet was there to simply check values were been written to the sheet whilst I was writing the various bits of code).
Once I was happy the code was working ok, I inserted a new sheet in the workbook and named it 'MainData' and renamed the 'DataTest' sheet to 'OldDataTest'
I then went back to the VBA window renamed the objects to 'shMainData' and 'shOldDataTest' and finally I updated all the old code references to 'shDataTest' and replaced them with the new 'shMainData' references.
But for some reason the code keeps erroring out - with run time error 1004 application-defined or object error. If I select then debug it takes me to the line
in the main module.
If I then re-name the sheets back to how they were originally everything works again
My in-experience in VBA is showing here as logically I'm think it can't be that hard to rename sheets and code but obvoisuley it is so could someone please tell me what I'm doing wrong.
Many thanks Paul
So I had a sheet named 'DataTest' (in Excel) and 'shData' in the VBA Objects. (The 'DataTest' sheet was there to simply check values were been written to the sheet whilst I was writing the various bits of code).
Once I was happy the code was working ok, I inserted a new sheet in the workbook and named it 'MainData' and renamed the 'DataTest' sheet to 'OldDataTest'
I then went back to the VBA window renamed the objects to 'shMainData' and 'shOldDataTest' and finally I updated all the old code references to 'shDataTest' and replaced them with the new 'shMainData' references.
But for some reason the code keeps erroring out - with run time error 1004 application-defined or object error. If I select then debug it takes me to the line
VBA Code:
frm.show
If I then re-name the sheets back to how they were originally everything works again
My in-experience in VBA is showing here as logically I'm think it can't be that hard to rename sheets and code but obvoisuley it is so could someone please tell me what I'm doing wrong.
Many thanks Paul