• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA: range.value =range.value/ possible size limit?

dan_l

Active Member
Here's my code:


Sub createplst()

Dim cell As Range

Dim recordcount As Integer

Dim ticker As Integer

Dim reqmoves As Integer

Dim cellrow As Integer


recordcount = Sheets("otl").UsedRange.Rows.Count

ticker = 2


'dfe P List

Sheets("plst").UsedRange.Delete


'apply headers to P list

Sheets("plst").Range(Sheets("plst").Cells(1, 1), Sheets("plst").Cells(1, 16)).Value = Sheets("otl").Range(Sheets("otl").Cells(1, 1), Sheets("otl").Cells(1, 16)).Value


For Each cell In Sheets("otl").Range(Sheets("otl").Cells(2, 16), Sheets("otl").Cells(recordcount, 16))

If cell.Value = "P" Then

cellrow = cell.Row

//Sheets("plst").Range(Sheets("plst").Cells(ticker, 1), //Sheets("plst").Cells(ticker, 16)).Value = //Sheets("otl").Range(Sheets("otl").Cells(cellrow, 1), Sheets("otl").Cells(cellrow, //16)).Value

ticker = ticker + 1

End If

Next cell


What's happening:

Selected cells from one list are being moved to another list. The cells are being moved as a row. The problem: This is grab bag data that comes out of a database. One of the fields is a gigantic blob of text. One record in particular throws an error. the only discernible difference between that record and any other, is that the big text field has a ton of text in it.


Now, if I just say----pick that cell and go Range("Junkcell").value = Range("mytroublecell").value, it works fine.
 
I agree that it should work...not sure why. Perhaps you could try using the clipboard instead to trnasfer the data?


Sheets("otl").Range(Sheets("otl").Cells(cellrow, 1), Sheets("otl").Cells(cellrow, 16)).Copy _

Destination:=Sheets("plst").Range(Sheets("plst").Cells(ticker, 1), Sheets("plst").Cells(ticker, 16))
 
Wow, that worked.


Thanks Luke.


MyVBAKnowledge = MyVBAKnowledge + 2


---------------


And that was the lamest joke I'll ever make. Ever.
 
Back
Top