Double quote entry in textbox causing runtime error 1004

TheWordsmith

New Member
Joined
Aug 1, 2017
Messages
3
Error message: Run-time error 1004: Application-defined or object-defined error.

Context: I have a userform with a textbox that I am using to enter data which is then written to a cell in an excel sheet. The problem I'm having is that when a quotation mark is entered into the text box it causes the above error on the line where the .value of the cell is set equal to a string containing the textbox entry. Note that this only crashes with a double quote, it works for other strings and even for single quotes.

Abbreviated version of the string that caused the crash: ... 1" charge line ...

Something interesting to note is that if I copy+paste into the textbox it doesn't crash, but if I type it in it does.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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