0
私はExcelでオートフィルタテーブルを持っています。特定の条件に基づいて貼り付け値をコピーする必要があり、特定の列のすべての表示セルでこれを実行する必要があります。私はコードを書いていますが、うまくいきますが、唯一のことは、多くの行があるので時間がかかることです。誰もが時間をスラッシュする方法を助けてくださいできますか?ここにコードがあります。ありがとう!オフセットを使用して次の可視セルに移動します。
Sub TrialAnotherOne()
Windows("Epson Itemcodes.xlsm").Activate
Range("A" & i).Select
Selection.Copy
Windows("Epson ASINs.xlsx").Activate
Range("U1048576").End(xlUp).Offset(0, -12).Select
If ActiveCell.Value <> "Itemcode" Then
If ActiveCell.Value = "" Then
ActiveSheet.Paste
Else
If ActiveCell.Value = Workbooks("Epson Itemcodes.xlsm").Sheets("Sheet1").Range("A" & i).Value Then
ActiveSheet.Paste
Else
ActiveCell.Value = "Conflct"
End If
End If
Else
Windows("Epson Itemcodes.xlsm").Activate
Range("I" & i).Value = "No match found"
End If
If ActiveCell.Value <> "Itemcode" Then
With ActiveSheet
Do
ActiveCell.Offset(-1, 0).Activate
Do While ActiveCell.EntireRow.Hidden = True
ActiveCell.Offset(-1, 0).Activate
Loop
If ActiveCell.Value <> "Itemcode" Then
If ActiveCell.Value = "" Then
ActiveSheet.Paste
Else
If ActiveCell.Value = Workbooks("Epson Itemcodes.xlsm").Sheets("Sheet1").Range("A" & i).Value Then
ActiveSheet.Paste
Else
ActiveCell.Value = "Conflct"
End If
End If
Else
Exit Do
End If
Loop
End With
End If
End Sub
あなたはこのビデオシリーズを見る必要があります:[エクセルVBA入門](https://www.youtube.com/playlist?list=PLNIs-AWhQzckr8Dgmgb3akx_gFMnpxTN5)。これは必須です:[Excel VBA入門第5部 - セル(範囲、セル、アクティブセル、終了、オフセット)の選択](https://www.youtube.com/watch?v=c8reU-H1PKQ&index=5&list=PLNIs- AWhQzckr8Dgmgb3akx_gFMnpxTN5&t = 3082s) –
質問をコードレビューに移す必要があります。リンクは次のとおりです。http://codereview.stackexchange.com/ –