Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying multiline textboxes from userform to worksheet cell

I have a userform that contains a multiline textbox with wordwrap.
This displays correctly on the userform.

I want to copy the contents of the textbox back into a worsheet cell
as follows

ActiveCell.Offset(0, 5).Value = frmAddIssue.TextBox2.Value

This works okay but the line breaks are displayed as 'square box'
characters in the cell - is there a way to avoid this?

Thanks in advance
Leighton
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copying multiline textboxes from userform to worksheet cell

ActiveCell.Offset(0, 5).Value = Application.Substitute( _
frmAddIssue.TextBox2.Value,chr(13)," ")

or if you have Excel 2000 or later, you can use the VBA replace function in
lieu of the worksheet function substitute.

Substitute will work in all versions of Excel.
--
Regards,
Tom Ogilvy

"Leighton Harker" wrote in message
om...
I have a userform that contains a multiline textbox with wordwrap.
This displays correctly on the userform.

I want to copy the contents of the textbox back into a worsheet cell
as follows

ActiveCell.Offset(0, 5).Value = frmAddIssue.TextBox2.Value

This works okay but the line breaks are displayed as 'square box'
characters in the cell - is there a way to avoid this?

Thanks in advance
Leighton



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm TextBoxes Rob Excel Discussion (Misc queries) 2 August 6th 05 03:07 AM
userform & textboxes beginner Excel Programming 3 July 27th 04 10:56 AM
how do I link Textboxes in a userform to a Cell in a Worksheet? Paul Clark Excel Programming 2 January 17th 04 05:16 PM
userform textboxes again Jo[_6_] Excel Programming 4 October 21st 03 07:25 PM
userform textboxes Jo[_6_] Excel Programming 4 October 21st 03 07:15 PM


All times are GMT +1. The time now is 06:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"