Unusual Behaviour Following Validation List Selection

MartinS

Active Member
Joined
Jun 17, 2003
Messages
490
Office Version
  1. 365
Platform
  1. Windows
Hi
An odd issue, that only seems to happen the first time you try and as long as the first time shows the lower options - once you move away from the cell and then re-try it works as expected. Unusual Behaviour Following Validation List Selection

So I have a series of Yes/No validation list cells, and depending on the response, the code will hide or show relevant rows lower down the spreadsheet, as well as further rows of these Yes/No responses. Without being able to attach images to my post (I am unable to upload images offsite to link to due to work restrictions), I shall try and explain what is happening.
So the 'default' position is that there are two rows of Yes/No selection visible. The first is set to Yes, the second No.
When the user switches the No to Yes, three rows directly below appear, each again with further Yes/No requests. The selected cell remains the same, i.e. the cell switched from No to Yes, but the dropdown indicator (to the right of the cell) jumps to the last row in the group. Whichever of the three cells are clicked on, the same cell (the one set to Yes) stays selected i.e. surrounded by a green border, the options Yes/No appear below the bottom cell but the response is stored in the selected cell.
If I then swap sheets, or click away from these cells, and then click back and repeat, it works as expected.
Has anyone seen anything similar? FYI the worksheet is protected, and the code to unprotect/protect is called during the show/hide routine.
Many thanks
Martin
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Without the ability to add attachments, this is difficult to explain clearly, but it's a real problem as it is hindering use of the spreadsheet. I've never seen it before in all my years of Excel development.
Has anyone seen similar, or know how I can attach images (I'm sure I have been able to previously, and it's not like i'm a new user?!
Thanks
Martin
 
Upvote 0
Does the same thing happen if the sheet is not protected? Sounds like a bug to me.
 
Upvote 0
Does the same thing happen if the sheet is not protected? Sounds like a bug to me.

Funny enough, as soon as the worksheet is unprotected, focus reverts to the correct row, so yes, I'd agree. Apart from keeping the sheet unprotected, nothing I can do I guess?
Thanks for your reply.
Regards
Martin
 
Upvote 0
Have you tried protecting on workbook_open with the userinterfaceonly option so that the code doesn't have to unprotect and reprotect?
 
Upvote 0
Have you tried protecting on workbook_open with the userinterfaceonly option so that the code doesn't have to unprotect and reprotect?

No, that's not currently the way it works, so definitely worth trying it that way to see if that makes a difference.
Many thanks.
Martin
 
Upvote 0
No, that's not currently the way it works, so definitely worth trying it that way to see if that makes a difference.
Many thanks.
Martin

Sadly, no difference. If the sheet remains unprotected, it works without issue.
 
Upvote 0
We found a work-around, by selecting (in code) cell A1 of the sheet in question, then the cell that was last changed, and this seems to be sufficient to trigger Excel to display correctly.
Thanks for your help
Regards
Martin
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top