problem with textbox linked with a cell

yukesh

New Member
Joined
Aug 31, 2002
Messages
2
I have a form on which I have put a textbox. I have linked that textbox to a cell on the sheet, so that the text in the textbox goes into the cell also. however, I find that the return keypress inside the textbox creates a square non-printing character, instead of a linefeed in the cell. is there any solution? Can the linked cell show the text of the textbox exactly as entered?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Richie(UK)

MrExcel MVP
Joined
May 17, 2002
Messages
3,329
Hi yukesh,

Welcome to the board. :)

Try looking up in the VBE Help the KeyDown and KeyUp events. This should help you to get the desired result.

A quick example:

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
'Check for the ENTER key
If KeyCode = 13 Then
MsgBox "You pressed the ENTER key"
End If
End Sub

HTH
 

Forum statistics

Threads
1,143,915
Messages
5,721,519
Members
422,369
Latest member
redinator

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
Top