How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Bryan Your Own Question

Bryan
Bryan, Computer Enthusiast
Category: Microsoft Office
Satisfied Customers: 1445
Experience:  Have been using MS Office since Office XP and know VBA coding very well
59162784
Type Your Microsoft Office Question Here...
Bryan is online now
A new question is answered every 9 seconds

how to code an editable, pop up text box attached to a single

This answer was rated:

how to code an editable, pop up text box attached to a single cell in 2007 Excel

Customer:

Welcome to JustAnswer. My name is XXXXX XXXXX I will be assisting you today.

Customer:

Are you referring to the "Comments" box in a cell?

Customer:

If the "Comments" box works for you, how do you want to activate the box? You can enter data into the cell, double-click on it, or there are a few other options. Let me know.

JACUSTOMER-197jhil9- :

Nope, my users don't know how to use comments. This is for a sales tracking sheet. I have attached the worksheet I am working off of. My users will enter up to 50 rows of data and the last 3 columns will be text for comments, updates and followup. If I just format with auto fit and wrap text I could have one cell that is 3 inches in height. That does not make a pleasant or tidy spreadsheet. So I want to have the user click on the cell, have a pop up text box where they can enter what they want and then when they go to the next cell it disappers but I can go back and view the text if needed.

JACUSTOMER-197jhil9- :

I can't attach the sheet - here is an image of what I mean

JACUSTOMER-197jhil9- :

Full Size Image

JACUSTOMER-197jhil9- :

Columns K, L and M need to have text entered by the user. I don't want to limit the amount. As you can see I entered a comment but but my users will not know how to view, enter or edit. I want them to be able to click on a cell ie K2, L2 or M2 and enter text in a pop up text box that will go away when they move to another cell. Make sense?

Customer:

It does. But there's no way to attach code to a cell itself. We can act on an action (like entering something into one of those fields, or double clicking on one of those cells). I can give you the code you need to automatically pop up the comment box when one of those actions is performed. And it will automatically be hidden when they leave the cell automatically. Would that work?

JACUSTOMER-197jhil9- :

I think that would work.

JACUSTOMER-197jhil9- :

So, user would doubleclick the cell, enter text, hit enter and the box would go away but would still be accessible if someone goes back to that cell.

Customer:

Exactly

JACUSTOMER-197jhil9- :

then that would work

JACUSTOMER-197jhil9- :

so what do I need to do on my end

JACUSTOMER-197jhil9- :

I am just trying to have a streamlined worksheet without huge cells with text

Customer:

I'll write up the code first, then I will show you how to enter it. First though, do you know how to enable "Developer" options in 2007? I'm using 2010 so I can't give you the exact method right now. But if you can't find it I will look it up for you.

JACUSTOMER-197jhil9- :

yup I do

JACUSTOMER-197jhil9- :

I have been playing with userforms etc today trying to figure out a solution but I am a newbie

Customer:

No problem at all. Give me a few to write the code for you. I'll write again as soon as it's done.

JACUSTOMER-197jhil9- :

step by step is fabulous

JACUSTOMER-197jhil9- :

you rock thanks

Customer:

No problem at all. Talk to you soon.

JACUSTOMER-197jhil9- :

thanks

Customer:

Should the comment be editable after the initial entry has been made?

Customer:

Actually, should this be a comment after all? Or just a "free flow" way of entering data into the cell?

JACUSTOMER-197jhil9- :

Just free flow? The users are sales folks so they just need a way to keep track where the super can check in and see where they are in the process

Customer:

Open Excel and hit Alt+F11

JACUSTOMER-197jhil9- :

ok

JACUSTOMER-197jhil9- :

vb pops up

Customer:

Do you have a worksheet already open?

JACUSTOMER-197jhil9- :

yup

Customer:

Excellent. Copy and past the text into the "Worksheet" object. Then save it as a macro-enabled document.

JACUSTOMER-197jhil9- :

I am under developer

Customer:

Go into VBA. Double-click the "ThisWorkBook" object. Then paste the text I sent into it.

JACUSTOMER-197jhil9- :

I don't think I did it righ

JACUSTOMER-197jhil9- :

ok

Customer:

Ok, see the code?

JACUSTOMER-197jhil9- :

ok went to VBA clicked on This Workseet in Nav

JACUSTOMER-197jhil9- :

pasted code in

JACUSTOMER-197jhil9- :

top says

Customer:

Excellent. Now do file-save and select a macro-enabled workbook. I think it's the second option.

JACUSTOMER-197jhil9- :

Workbook and then Sheet before Double Click

Customer:

Ok, good

Customer:

Tell me when it's saved.

JACUSTOMER-197jhil9- :

it is

Customer:

Ok, close VBA. he go double-click on K2

Customer:

he = then

Customer:

My fingers are moving too fast. ;)

JACUSTOMER-197jhil9- :

:-)

JACUSTOMER-197jhil9- :

I double click and nothing so I must have done something wrong

Customer:

No problem. One sec. I am going to upload the workbook I used as a test. That way you can see what needs to be done.

JACUSTOMER-197jhil9- :

ok

JACUSTOMER-197jhil9- :

I think I got it

JACUSTOMER-197jhil9- :

hold on

Customer:

ok

JACUSTOMER-197jhil9- :

ok so I get the enter comment box

JACUSTOMER-197jhil9- :

I am playing with text how do I get the comment box to go away?

Customer:

Move your mouse away from K2. It should go away automatically.

JACUSTOMER-197jhil9- :

I had to change the setting to show/hide comment

Customer:

ahhh ... ok

JACUSTOMER-197jhil9- :

can I duplicate the coding for more rows?

Customer:

I think I had done that part manually. Sorry.

JACUSTOMER-197jhil9- :

np so I can duplicate for more rows?

Customer:

Yep. Do you see the test condition at the 3rd or 4th row? Just add more conditions to match there.

JACUSTOMER-197jhil9- :

yup

JACUSTOMER-197jhil9- :

so and no way to change comment command to a text box command?

Customer:

Nope. The inputbox is the best we can do. I tried playing with the size a bit, but the best I could do was change the popup position.

JACUSTOMER-197jhil9- :

ok, then this is GREAT

Customer:

Excellent! I'm glad you like it. :) Let me know if you need anything else. And keep my name handy if you ever need help again. I'm more than happy. :)

JACUSTOMER-197jhil9- :

This is great

JACUSTOMER-197jhil9- :

how do I pay you

Customer:

All you do is click the rating below. That will close the question and send payment. I appreciate it. Have a great night!

JACUSTOMER-197jhil9- :

thank you

Bryan and 5 other Microsoft Office Specialists are ready to help you
Customer: replied 3 years ago.

I can't figure out how to duplicate the fucntion going down the column can I not use this type?


 


"$K$2" use "$K$2:$K$100"


 


I can get it to work if I do another string of $K$3 but that would take forever there has to be a shorter way.


 


Thoughts?

Give me just a minute. I have to run back upstairs.

Change:

If (Target.Address = "$K$2") Or (Target.Address = "$L$2") Or (Target.Address = "$M$2") Then

to read:

If (Target.Column = 11) Or (Target.Column = 12) Or (Target.Column = 13) Then

That will affect all rows in K, L, M columns.