LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help - macro messes up the character formating

Greetings,

I need help with a macro.

I use this macro in Excel 2007:

Sub ReplaceTags2()
For Each c In ActiveCell.CurrentRegion.Cells
c.Value = Application.WorksheetFunction.Substitute(c, "####", Chr(10)
& Chr(10))
Next
End Sub

My data contains the markers ####, which I want to replace with
linebreaks.

The macro does its work but messes up the formatting in the cells. I
uploaded the file "Book1.xlsm" he http://www.box.net/shared/8rdsg533qp

The file contains a sample of the data + the macro itself.

Can anyone help me modify the macro to do the replacement without
changing anything to the cell formatting?
Thanks in advance!
 
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
Sort messes up pictures hdille Excel Discussion (Misc queries) 1 March 23rd 10 12:00 PM
Search and Replace a Spacific Character with Conditional Formating Dallas Excel Programming 15 December 15th 08 09:11 PM
Date Formating and building character strings C Brandt Excel Discussion (Misc queries) 5 August 18th 07 03:39 AM
auto-filter messes up the formulas Drew2006 Excel Discussion (Misc queries) 1 September 6th 06 08:58 AM
Character formating for User defined function problem RosH Excel Programming 5 December 26th 05 05:46 PM


All times are GMT +1. The time now is 12:00 AM.

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"