ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text is Truncated With String Variable (https://www.excelbanter.com/excel-programming/438675-text-truncated-string-variable.html)

EricG

Text is Truncated With String Variable
 
If I do this:

Dim theTxt as String

theTxt = Activesheet.Cells(1,1).Text

for some reason the text (which is actually 1849 characters long) is
truncated to 1024 characters.

If I do this:

Dim theTxt as Variant

theTxt = Activesheet.Cells(1,1)

I get the complete text string from the cell.

Can someone tell me why these two approaches are giving me different results?

Thanks,

Eric


Dave Peterson

Text is Truncated With String Variable
 
One uses the .text property, the other uses the default property (.value).



EricG wrote:

If I do this:

Dim theTxt as String

theTxt = Activesheet.Cells(1,1).Text

for some reason the text (which is actually 1849 characters long) is
truncated to 1024 characters.

If I do this:

Dim theTxt as Variant

theTxt = Activesheet.Cells(1,1)

I get the complete text string from the cell.

Can someone tell me why these two approaches are giving me different results?

Thanks,

Eric


--

Dave Peterson


All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com