Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Boxes in my text

Hi

I have imported an address from outlook and pasted it into on cell in
excel. The line of text includes the carriage return boxes.

How can change my code to replace the boxes for a space.

ActiveCell.Offset(0, 1).Select
Selection = .BusinessAddress


Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Boxes in my text

Adam,

First of all, it is better not to Select a cell and then work with
Selection. Instead, work with the cell directly. E.g.,

ActiveCell.Offset(0,1).Value = .BusinessAddress

You can use the Replace function to replace the line break character(s) with
spaces:

ActiveCell.Offset(0,1).Value = Replace(.BusinessAddress, Chr(10), " ")

What value you need with Chr depends on what character (10, 13, or both 10
and 13 together) is in the BusinessAddress string. If you put it in a cell,
you can use my Cell View add-in to see what character(s) is represented by
the box character. E.g.,

Range("A1").Value = .BusinessAddress

and then view the contents of A1 with CellView.
www.cpearson.com/excel/cellview.htm

Or, you could just do two Replace calls.

Dim S As String
S = .BusinessAddress
Replace(Replace(S, Chr(10), " "), Chr(13), " ")
ActiveCell.Offset(0,1).Value = S

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)




"Adam" wrote in message
ups.com...
Hi

I have imported an address from outlook and pasted it into on cell in
excel. The line of text includes the carriage return boxes.

How can change my code to replace the boxes for a space.

ActiveCell.Offset(0, 1).Select
Selection = .BusinessAddress


Thanks


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
Default font for pasted text in text boxes - Excel 2007 MS OFFICE USER EIT Excel Discussion (Misc queries) 0 March 25th 10 09:01 PM
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
How to Import Visio Text Boxes into Excel as Text Nick_adminator Excel Discussion (Misc queries) 2 December 12th 07 05:56 AM
How do I link Text Boxes to Cells, not Cells to Text Boxes? Ebby Excel Worksheet Functions 1 May 15th 07 11:31 PM
In Excel, option to enter text in cells the same as text boxes RobGMU Excel Worksheet Functions 0 October 26th 05 04:20 PM


All times are GMT +1. The time now is 10:33 AM.

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

About Us

"It's about Microsoft Excel"