|
▼おにこ さん:
要件を誤解していたらごめんなさい。
Sub Sample1()
Dim x As Long
Dim z As Long
Dim n As Long
Dim sh As Worksheet
Dim colP As Variant
Dim colW As Variant
Application.ScreenUpdating = False
Set sh = Sheets("Sheet1") '元シート
z = sh.UsedRange.Cells(sh.UsedRange.Cells.Count).Row
colP = sh.Columns("P").Resize(z).Value
colW = sh.Columns("W").Resize(z).Value
n = Sheets.Count
Sheets.Add after:=Sheets(Sheets.Count), Count:=34
For x = 1 To 34
With Sheets(n + x)
.Range("A1").Resize(z).Value = colP
.Range("B1").Resize(z).Value = colW
.Range("C1").Resize(z).Value = sh.Columns(x).Resize(z).Value
.Name = sh.Cells(1, x).Value
End With
Next
Application.ScreenUpdating = True
MsgBox "転記終了"
End Sub
|
|