我需要从工作表ABC中复制数据。我知道列号,开始行和结束行。当我尝试以下代码时,它会抛出错误。任何帮助都会很棒
workbooks("ABC").worksheets("abc").range(cells(startrow,1),cells(endrow,1)).copy
答案 0 :(得分:0)
一个衬垫很难处理。分解有帮助:
dispatch_async(dispatch_get_main_queue()) {
if PFUser.currentUser()?.objectId != nil {
if (post["likers"] as! NSMutableArray).containsObject(PFUser.currentUser()!.objectId!) {
postCellObj.likeButton.setTitle("Unlike", forState: .Normal)
} else {
postCellObj.likeButton.setTitle("Like", forState: .Normal)
}
} else {
postCellObj.likeButton.setTitle("Like", forState: .Normal)
}
}
postCellObj.numberOfLikes.text = ((post["likers"] as! [String]).count - 1).description + " Likes"
我认为您的主要错误不符合Dim wks As Worksheet
Dim startrow, endrow
startrow = 1
endrow = 10
Set wks = ThisWorkbook.Worksheets("stops") ' my test sheet
' copy first column to clipboard
wks.Range(wks.Cells(startrow, 1), wks.Cells(endrow, 1)).Copy
参考资格。它可能适用于单个工作表,但不适用于其他工作表或工作簿。
Cells