|
ごめん、
Application.Intersect(.CurrentRegion, .CurrentRegion.Offset(1)).EntireRow.Delete
は、
Application.Intersect(.CurrentRegion, .CurrentRegion.Offset(1)) _
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
の間違い
因って以下の様に修正して下さい
With Sheets(strSheetname).Range("A1")
.AutoFilter Field:=9, Criteria1:="ワンルーム"
.CurrentRegion.Copy Destination:=Sheets("ワンルーム").Range("A1")
Application.Intersect(.CurrentRegion, .CurrentRegion.Offset(1)) _
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilter
'
.AutoFilter Field:=8, Criteria1:="1"
.CurrentRegion.Copy Destination:=Sheets("1部屋").Range("A1")
Application.Intersect(.CurrentRegion, .CurrentRegion.Offset(1)) _
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilter
'
.AutoFilter Field:=8, Criteria1:="2"
.CurrentRegion.Copy Destination:=Sheets("2部屋").Range("A1")
Application.Intersect(.CurrentRegion, .CurrentRegion.Offset(1)) _
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilter
'
.AutoFilter Field:=8, Criteria1:="3"
.CurrentRegion.Copy Destination:=Sheets("3部屋").Range("A1")
Application.Intersect(.CurrentRegion, .CurrentRegion.Offset(1)) _
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilter
'
.CurrentRegion.Copy Destination:=Sheets("4部屋").Range("A1")
.CurrentRegion.EntireRow.Delete
End With
|
|