easy question : textbox

Y

Yan Robidoux

Hello there...

I want to use a textbox to make people enter their info into m
worksheet. problem is : it been about 5 years since i last used vb AN
i never used it in excell.... thus the question :

How do you make a textbox in excell ?
How do you make it appear wenever someone clik in the right cell ?

thanks a lot

Ya
 
Y

Yan Robidoux

hehe sorry i might not have been all that clear (as you probabl
figured now im not all that good in english)

by text box i meant a box in wich the user can enter text... as i a
able to get msgbox but not "textbox"... cause i dont know what it cal
lo
 
Y

Yan Robidoux

Got it.... now i can make it appear wenever i open or close
worksheet... but i would like to make it appear wenever i select
specific cell in the sheet... let say h3 ...

how can i do that ? there must be a way but my vb programming is so
far away.....

thanks for the previous answer and thank ahead for the next answer ;-)

PS: oh ! and tom you can post your answer only one time it enough :-
just kidding..... thank it was of great hel
 
F

Frank Kabel

Hi
use the selection_change event (event procedures: see:
http://cpearson.com/excel/events.htm). In your case try:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim res
If Intersect(Target, Me.Range("B3")) Is Nothing Then Exit Sub
Application.EnableEvents = False
res = InputBox("Enter a value")
Target.Value = res
Application.EnableEvents = True
End Sub

Put this in your worksheet module (not in a standard module)
 
Top