|
ちまちまやっているのを見てられないので...。
1行目挿入しちゃっているのでダメかも。
Sub wwwwkw()
Dim SPG As Range
With ThisWorkbook.Worksheets("Word")
WordWSLastColumn = .Cells(1, Columns.Count).End(xlToLeft).Column '1行目の最後の列
.Rows(1).Insert
.Range("A1").Resize(, WordWSLastColumn).Value = "あああ"
DoEvents
For i = 1 To WordWSLastColumn '- 1
WordWSLastRow = .Cells(Rows.Count, i).End(xlUp).Row
'.Range(.Cells(2, i), .Cells(WordWSLastRow, i)).Select
.Range(.Cells(2, i), .Cells(WordWSLastRow, i)).AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Set SPG = .Range(.Cells(2, i), .Cells(WordWSLastRow, i)).SpecialCells(xlCellTypeVisible)
.ShowAllData
SPG.Copy
.Cells(Rows.Count, i + 1).End(xlUp).Offset(1).PasteSpecial (xlPasteValues)
Next i
.Rows(1).Delete
Application.CutCopyMode = False
End With
End Su
|
|