我的目标是获取行尺寸可变的Excel文档,将其复制,然后将其粘贴到新文档的底部。
从长远来看,我需要获取每月的销售报告,并将其堆叠到更大的excel文件中。每个月我们都会进行不同数量的销售。我需要将所有这些月份汇总在一起,以便我们进行处理。
我有一些我认为下面的代码。它能够在不同的工作表中移动变量行,但是对于不同的工作簿则不能这样做。
Private Sub MoveRowToEndOfTable()
Dim LastRow As Long
LastRow = Cells.Find(What:="*", SearchOrder:=xlByRows,SearchDirection:=xlPrevious).Row
Sheets(1).Range("A2:A" & LastRow, "G2:G" & LastRow).Copy
Workbooks("BRN report Aggregator.xlsx").Worksheets("New shares EOM").Range("a6000").End(xlUp).Offset(1, 0).Cells.Insert
End Sub
答案 0 :(得分:0)
我想您的工作簿已关闭,请在粘贴值之前检查它(如果工作簿已关闭〜>打开它):
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="----=_Part_946d8daa50ab44b699f82dbd3c6bacc0"
------=_Part_946d8daa50ab44b699f82dbd3c6bacc0
Content-Type: application/EDIFACT
Content-Transfer-Encoding: binary
Content-Disposition: attachment filename= HelloWorld.txt
test
------=_Part_946d8daa50ab44b699f82dbd3c6bacc0
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment filename="smime.p7s"
MIIEmQYJKoZIhvcNAQcCoIIEijCCBIYCAQExDTALBglghkgBZQMEAgEwCwYJKoZIhvcNAQcBoIID
EzCCAw8wggH3oAMCAQICEHRJ0r9pduGJTCHsDzuElc4wDQYJKoZIhvcNAQELBQAwETEPMA0GA1UE
AwwGTXlDZXJ0MB4XDTE5MDMyNTEzNTQzMloXDTIwMDMyNTE0MTQzMlowETEPMA0GA1UEAwwGTXlD
ZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApOwOacjTjhHOqTzq3EhnQG3HHfO8
YjCE/+CKcbz++mCQ2gkNVyx37rnrNrSuPp6rYZioKss9sYtwaYUe4iyisZBe7rK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