Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy & paste code 1

Status
Not open for further replies.

max1565

Technical User
Dec 16, 2002
57
US
I get an error (runtime-error '6': overflow every time the following code is executed. Could someone tell me what the problem is?

Dim LastRow As Integer
LastRow = sheets("database").Range("A3").End(xlDown).Row
sheets("TEMPDB").Range("a3:AI3").Copy Destination:= _
sheets("database").Range("A" & LastRow + 1)

Thanks
 
Hi max1565,

How many rows are in your worksheet? An Integer can only hold a value up to 32K. Try DIMming LastRow As Long if you have more than that - it's good practice for any row variable anyway.

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top