Line-breaks in Userforms freezes Excel

shanilkarunananda

New Member
Joined
Jan 6, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Am using userforms on a spreadsheet to populate content to cells within a worksheet. The links are working perfectly and the data is being copied across precisely, from the userform to the cell and visa versa.
However, when a line-break is added (ALT+ENTER on the worksheet / ENTER on the userform) at any point, Excel freezes once I exit the cell or click away from the userform text box. This occurs when adding line-breaks on any text box on the userform.

I have removed all coding on the worksheet but the above issue persists; hence, not related to the coding.

Anyone able to help?
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
welcome to the forum

Does the problem happen if you do this?
... open NEW workbook
.......enter something in a cell
.......... add a line break with {ALT}{ENTER}
 

shanilkarunananda

New Member
Joined
Jan 6, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Cheers for the welcome!
Happens when I add a line break in the userform text box / cell to which the userform text boxes are linked.
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
We are both using 365 - but I cannot replicate your problem as picture below illustrates
I can insert line breaks either in the textbox (enter) or if I enter directly in the cell (alt enter)

Am I doing something different to you?

This is what I am doing
- Insert Active-X textbox on the worksheet
- Link to cell
- Enter behaviour set to TRUE
- Multiline set to TRUE


ActiveXTextBox.jpg
ActiveXTextBox.jpg
 

shanilkarunananda

New Member
Joined
Jan 6, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

I'm using Userforms which is embedded within VB, which is then linked to cells on the tab. Have attached the where the form sits within the VBA, as well as the properties of the said text box.

Thanks.
 

Attachments

  • Userform.PNG
    Userform.PNG
    15.5 KB · Views: 4
  • Properties.PNG
    Properties.PNG
    26.2 KB · Views: 4

shanilkarunananda

New Member
Joined
Jan 6, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
^the form and the cell is link through the "ControlSource" line found within properties.
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
Again I cannot replicate your issue

I named cell A4 LinkedCell
UserForm Linked Cell.jpg


I used that as control source property for the textbox in the useform
EnterKey behaviour = TRUE
Multiline = TRUE

UserFormProperties.jpg

And displayed the userform
... placed text with linebreaks (enter) in TextBox
... closed userform
... added text with linebreaks (alt enter) in cell A4
... displayed the userform

The link works and the text contains the correct line breaks in BOTH cell and textbox
UserFormLinkedTextBox.jpg
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
Close Excel completely

Open a NEW workbook (must be NEW!)
Do ONLY what I did above
- Create Named Range LinkedCell with refers to = A4
- Create a UserForm
- Add textbox amending only ...
. ControlSource LinkedCell
. EnterKey behaviour TRUE
. Multiline TRUE

Display the userform and test

Does EXCEL crash this time ?
 

Watch MrExcel Video

Forum statistics

Threads
1,123,252
Messages
5,600,543
Members
414,387
Latest member
Vincent88

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