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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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
 
Upvote 0

Forum statistics

Threads
1,219,162
Messages
6,146,659
Members
450,706
Latest member
LGVBPP

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