LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Excel VBA: Worksheet cell .Text property: 1024 bytes text len limit

Perhaps I misunderstood loyso's problem, and loyso - apologies if I did.

As you say, why not return myCell.Value, or as Value is the default property
simply:

myVar = myCell

Regards,
Peter T

"Dave Peterson" wrote in message
...
This may illustrate loyso's problem:


Option Explicit
Sub testme()
Dim myCell As Range
Set myCell = ActiveSheet.Range("a1")
myCell.Formula = "=rept(""asdf "",500)"
With myCell
Debug.Print "Value length: " & Len(myCell.Value)
Debug.Print "Text Length: " & Len(myCell.Text)
End With
End Sub

Returned:

Value length: 2500
Text Length: 1024



Peter T wrote:

Is the cell a formula beginning with =. If so you can neither Read nor

Write
a formula with length 1024 including the "=".

Otherwise, as I said previously a cell can contain text up to the 32K
character length limit, as my example routine demonstrated.

Regards,
Peter T

"loyso" wrote in message
...
Cells can contain text with length up to 32k. But a msgbox can only
display
1024 characters.

No! The problem isn't msgbox-related!
I see in integrated excel debugger that Len function returns 1024 for

my
cell with 4k of text!

For Each ws In Worksheets
MsgBox Len(ws.Cells(1, 1).Text)
Next ws

Also displayes 1024 in message box.

Somebody - help me, please! :)


--
Alexei Baskakov



--

Dave Peterson



 
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
Excel text export limit - 1024 per line (not cell), workaround? Dave Excel Discussion (Misc queries) 11 August 11th 09 04:41 PM
Importing text--cell text limit? Scout Excel Discussion (Misc queries) 1 July 2nd 08 08:38 PM
Display text 1024 characters in a cell Martin Excel Worksheet Functions 6 November 12th 05 11:25 PM
Range.Formula in Excel 2003 gives Error reading formulas just below 1024 bytes Frank Jones Excel Programming 14 July 9th 04 06:25 AM
Help with text box limit (1024) irais Excel Programming 2 November 28th 03 04:18 PM


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