Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 11th, 2005, 05:36 PM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Code to Remove Carriage Return From Spreadsheet

Does anyone know of any Excel 2003 VBA macro code that can remove carriage returns from the text values in cells?

I foolishly thought I could have the macro do a Find and Replace, but I can't seem to get the macro to recognize a carriage return as the text to find.

Also, please do not suggest the CLEAN() function. It is not an option for me.

Thanks!

Eric

Eric G.
 
Old May 12th, 2005, 02:12 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default


    Cells.Replace What:=Chr$(10), Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False

cheers

Matthew

 
Old May 12th, 2005, 08:35 AM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Matthew. That worked!

Eric

Eric G.





Similar Threads
Thread Thread Starter Forum Replies Last Post
remove carriage return character in a textbox maricar C# 5 September 15th, 2017 09:38 AM
Checking for a Carriage return darkhalf Classic ASP Databases 2 November 5th, 2007 06:15 AM
insert carriage return darkhalf Javascript 0 April 10th, 2007 02:42 PM
about carriage return... edu1980 XSLT 1 July 5th, 2006 04:11 AM
New Line/Carriage Return interrupt Javascript How-To 7 October 3rd, 2004 06:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.