Write array to destination stops at row 3699

sonicroc

New Member
Joined
Apr 6, 2020
Messages
14
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
  2. Web
I am pretty confident this is a new problem.
Recently a routine I wrote started behaving strange in my investigation in found that when I write and array of data to either a range or table that it is only providing data up to row 3699.
It is consistent whether I write to a table or range. Yes, I am adequately re-sizing the range or Table for the incoming data. The array is 1 to 15777r by 1 to 35c.
---Sample---
Set drng = Worksheets("Tickets2").Range("A1").Resize(UBound(tktA, 1), UBound(tktA, 2))
drng = tktA


tkt_T.DataBodyRange = tktA
 
Whilst using transpose (or possibly Index) with arrays you can get problems with long text strings, I've never encountered any problems when trying to write the array to the sheet like your doing.
So not quite sure what the problem is.
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
drng needs to be declared, otherwise the Value property needs to be specified. Is it declared? If not, try...

VBA Code:
drng.value = tktA
 
Last edited:
Upvote 0
drng needs to be declared, otherwise the Value property needs to be specified. Is it declared? If not, try...

VBA Code:
drng.value = tktA
Tried that before identifying the data issue.
 
Upvote 0
I believe it is a cell that contains this string that is causing the issue.
"============================================
...
=============================="
For values like the above and some more ("==", "++", "--") you need to format destination columns as Text.
Like this:
VBA Code:
Sub Test()
  Dim a(1 To 2, 1 To 1)
  a(1, 1) = "=="  ' Problematic value
  a(2, 1) = "++"  ' Problematic value
  Range("A1:A2").NumberFormat = "@" '<-- Set Text format
  Range("A1:A2").Value = a()
End Sub

Sub Test1()
  
  Dim drng As Range, tktA As Variant
  
  ReDim tktA(1 To 2, 1 To 10)
  tktA(1, 4) = "==" ' Problematic value
  tktA(2, 5) = "++" ' Problematic value
  
  Set drng = Worksheets("Tickets2").Range("A1").Resize(UBound(tktA, 1), UBound(tktA, 2))
  
  drng.Columns("C:I").NumberFormat = "@" '<-- Set Text format
  
  drng.Value = tktA
  
End Sub
 
Upvote 0
Thank you for the suggestion, however that did not work either..
I was successful in resolving my issue, but instead of formatting the destination I had to format the source like this using ".Text" on the databodyrange from where I was importing the data to my first array.
ctktdA = ctktdT.DataBodyRange.Text

After that it worked without issue when outputting to a table or range.
 
Upvote 0
Thanks for letting us know that the problem is solved.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,537
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top