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: 35
Default Cell formatting shows in formula bar but not in cell

I am at my wits end here. I have code from Access that dumps data to an Excel
spreadsheet. Several values in one of my columns are pieces of text with
Chr(10) between them so that each piece of text falls on a separate line
within the cell.

The text gets dumped, but the separate lines do not show on the sheet in the
cell ( Chr(10) shows in the cell as a little box). However, they do show in
the formula bar as separate lines and if I click in the formula bar or
double-click the cell everything falls into place. I just cant get this to
happen automatically from code.

Here is the code that sets the value that gets dumped to my sheet. Im
cycling through a record set in Access, doing a replacement of ";" by Chr(10)
and then setting the cells formula value to the new value. I use a semicolon
as a placeholder to tell my code where I want new lines to start. The
separated parts of text are long strings and separating them to different
lines makes it much easier for my users to read.

NewValue = rs.Fields(iFieldNum - 1)
NewValue = Replace(NewValue, ";", Chr(10))
.Cells(I, iFieldNum).Formula = NewValue

Ive tried many options to get this to work. Any suggestions would be
greatly appreciated.

Clint

 
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
cell formatting shows the formula not the value gjmink Excel Worksheet Functions 2 December 5th 06 06:33 PM
format a cell with a formula so an empty reference cell shows blan M2 Excel Discussion (Misc queries) 3 November 7th 06 10:42 PM
cell shows 20. Formula shows 20. why not 540/27 griswold Excel Worksheet Functions 2 August 12th 05 05:56 PM
Cell shows only formula, no result alexrm Excel Worksheet Functions 1 June 27th 05 11:09 PM
Cell formatting - "" shows as 1/0/1900 seve Excel Discussion (Misc queries) 2 January 16th 05 01:09 AM


All times are GMT +1. The time now is 11:57 PM.

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"