1

My working code has the line,

Cells(i - 1, 13) = Cells(i, 1)

Where Cells(i - 1,13) is blank, and Cells(i,1) contains text. The macro works fine, but when cells(i,1) has a very large amount of text, it throws up a Runtime error.

Is there a workaround for this? I know the problem is caused by the string being too long, as making it shorter avoids the error. It also works fine if I copy and paste the contents of the cell, rather than 'equalling' them. Googling gave me little information on this. Has anyone come across this limitation before?

user1996971
  • 543
  • 5
  • 20
  • 1
    Possible duplicate of [Error while copying more than 8202 characters from one cell to another](http://stackoverflow.com/questions/27085656/error-while-copying-more-than-8202-characters-from-one-cell-to-another) – arcadeprecinct May 23 '16 at 10:28
  • `making it shorter avoids the error. It also works fine if I copy and paste the contents of the cell, rather than 'equalling' them.` so what is your question then? – SierraOscar May 23 '16 at 10:30
  • I mean, I don't want to make the string shorter. I need the script to work on it as is. I mentioned this just to demonstrate that the length of the string was causing the error. – user1996971 May 23 '16 at 10:41

1 Answers1

2

Try to use this: Cells(i - 1, 13).Value = Cells(i, 1).Value

Dawid SA Tokyo
  • 376
  • 1
  • 8