Userform Question

J

jnf40

I have a Userform that pops up when a cell is selected. Is there a way to
have the Userform NOT pop up if the cell is selected with code that reformats
that particular cell?
 
J

JLGWhiz

You probably have code in your sheet module that causes the pop up. It was
most likely put there for a reason by someone who designed the workbook. You
can get rid of the pop up by deleting the code, but I would check with the
author first.
 
T

Tim Williams

If you're referring to code you wrote to perform the reformatting:
there's no need to select a cell to reformat it.
You could post the problem code for suggestions.

Tim
 
J

jnf40

I designed the workbook, and yes I do have code in the sheet module that
causes the pop up. When cell B2 is selected the userform pops up. If the user
wants to clear the entriies they have made they click a button and it
reformats the row to it's original state, however when it does the procedure
of reformatting the row since cell B2 is selected during the reformat it
causes the userform to pop up. I was just wondering if there was a way to
keep the userform from popping up during the reformat process or if maybe I
could have the close button, the red X, in the upper right corner of the
userform be utilized through code.
Thanks
 
T

Tim Williams

Show the code that does the reformatting. It should not require selecting
the cell.

Tim
 
J

jnf40

Ok I checked the code and I can reformat the cells without selecting them,
however is there a way to lock and unlock cells without selecting them? I
have tried what I know and I get 'Unable to set the Locked property of the
Range class' message.
 
T

Tim Williams

Ok I checked the code and I can reformat the cells without selecting them,
however is there a way to lock and unlock cells without selecting them? I
have tried what I know and I get 'Unable to set the Locked property of the
Range class' message.

If the sheet is protected then you'll have to unprotect it before
unlocking the cells and then relock it.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top