Hi everyone (Ok, it's my first post...)
I have some code behind one sheet (sheet1) which includes a routine to hide/unhide some rows in another sheet (sheet2) in the same workbook and enable/disable some CheckBoxes. The original version (which worked) included a sheet1.select statement and then used statements such as sheets("sheet2").rows(x:y).entirerow.hidden = True/False to hide the x:y rows. Sheet2 also has a couple of checkboxes eg checkbox1 which it enabled/disabled using sheets("sheet2").checkbox1.enabled = True.
In attempting to tidy this up (more fool me) I have sought to avoid the 'select' statement (as I don't need to change any values in sheet2, just hide/enable as above) and have also set a worksheet variable in place of sheets("sheet2")
So I start with something like..
I then have statements likePlease Login or Register to view this content.
When I try and run this I get a compile error - 'Method of Data member not found' referring to the ws.checkbox1.enabled = true line. I did think this might be connected to the .exd file issue but having deleted these it makes no difference.Please Login or Register to view this content.
if I comment out this offending line and replace it with sheets("sheet2").checkbox1.enabled = true, then all is well.
Am I missing something? Could it be that whilst hiding lines in another sheet can be done without a select statement (ie without making Sheet2 the active sheet) this does not apply to checkboxes? I've tried adding a ws.select or even a sheets("sheet2").select statement but I still get the same compile error.
Any ideas...?
Bookmarks