Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default having trouble writing string to cell-xl2k

Hello!
I have some code that writes from an array to a cell. The
problem is that sometimes the string may have hyphen characters in it
which seems to cause excel to assume it's a formula. This causes out
of memory errors because the string may be very long. I've tried
setting the cell to be text before writing to it but xl still wants to
make it a formula. If I remove the hyphens it works fine but I don't
want to do that. This is the code I'm using:

'start code

rCell.Offset(i, 8).NumberFormat = "@"
rCell.Offset(i, 8).Value = udtDr(i).string(j)

'udtDr is user defined type

'end code

Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default having trouble writing string to cell-xl2k

Hey that works great -Thanks!

On Thu, 14 Apr 2005 10:06:03 -0700, DragonDom
wrote:

Try concatenating a single quotation mark( ' ) before the string before
writing to the cell.

"Terry Carpenter" wrote:

Hello!
I have some code that writes from an array to a cell. The
problem is that sometimes the string may have hyphen characters in it
which seems to cause excel to assume it's a formula. This causes out
of memory errors because the string may be very long. I've tried
setting the cell to be text before writing to it but xl still wants to
make it a formula. If I remove the hyphens it works fine but I don't
want to do that. This is the code I'm using:

'start code

rCell.Offset(i, 8).NumberFormat = "@"
rCell.Offset(i, 8).Value = udtDr(i).string(j)

'udtDr is user defined type

'end code

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
Trouble writing an excel formula. hbb2699 Excel Worksheet Functions 3 June 8th 06 06:36 PM
XL2K - Conditional Formatting relative to cell selection Lezh Excel Discussion (Misc queries) 3 December 31st 05 09:56 AM
On click, copy text into another cell - XL2K Bob the Builder Excel Worksheet Functions 2 March 16th 05 10:03 PM
Trouble writing an excel formula... Stumped by If Thens.... Excel Worksheet Functions 3 December 19th 04 02:39 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


All times are GMT +1. The time now is 08:26 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"