軟體:excel
版本:2016
原檔:
https://imgur.com/JdfTA4n
想改成
https://imgur.com/6QTVThH
想把原檔案轉至後貼到另一個新檔案,並且按照分公司名稱存檔
有嘗試爬文來修正,但一直失敗...
遇到有合併的存儲格無法抓取,也不知道怎麼轉置
想請教各位大大幫忙
Sub Macro1()
Dim rLastCell As Range
Dim strName As String
Dim lLoop As Long
Dim wbNew As Workbook
Dim cnt As Integer
With ThisWorkbook.Sheets(1)
Set rLastCell = .Cells.Find(What:="*", After:=[A1], _
SearchDirection:=xlPrevious)
For lLoop = 2 To rLastCell.Row
cnt = WorksheetFunction.CountIf(Range("c:c"), Range("c" & lLoop))
Set wbNew = Workbooks.Add
試跑到這邊都是正常的,但後續就不知道如何處理了
謝謝