我想將紙張CurrentDistribution
與紙張distribution1
連接起來。爲此,我查看最後一行distribution1
,並在最後一行之後複製CurrentDistribution
的內容。將內容從一張紙複製到另一張時出錯
LastCellCurrentDistribution = FindLastCell(CurrentDistribution)
LastCellDistribution1 = FindLastCell("distribution1")
LastRowInDistribution1 = Right(LastCellDistribution1, Len(LastCellDistribution1) - 1)
Sheets(CurrentDistribution).Range("A4:" + LastCellCurrentDistribution).Copy Sheets("distribution1").Range("A" + CStr((CInt(LastRowInDistribution1) + 1))) 'i only wany the row (number), not the column (letter)
Sheets(CurrentDistribution).Delete
現在的問題是,當我嘗試這樣做,我得到這個錯誤:'Run-time error '6': Overflow'
。我用調試器,發現它的第四行復制了引發這個錯誤的東西。任何想法是什麼問題以及如何修復它?