■ このスレッドは過去ログ倉庫に格納されています
Excel VBA 質問スレ Part80
- 239 :デフォルトの名無しさん:2023/12/04(月) 16:43:57.28 ID:Nbpgvbo/.net
- 質問パクったわけではないですが確かに似てますね
省略しないと以下になります
処理の内容は同じです
■うまくいく方
For Each rng In Range(Cells(3, 7), Cells(m, n))
If rng.Column <> 9 Then
If rng.Value = "-" Then
dataEx.Cells(j, i) = ThisWorkbook.Sheets(dataEx.Cells(1, i).Value).Cells(rng.Row, 3).Value
dataEx.Cells(j, i + 1) = ThisWorkbook.Sheets(dataEx.Cells(1, i).Value).Cells(2, rng.Column).Value
j = j + 1
End If
End If
-----------------------------------------------------------------
■すべてスキップされてしまう方
For Each rng In Range(Cells(3, 7), Cells(m, n))
If rng.Column = 9 Then
GoTo skipCol
If rng.Value = "-" Then
dataEx.Cells(j, i) = ThisWorkbook.Sheets(dataEx.Cells(1, i).Value).Cells(rng.Row, 3).Value
dataEx.Cells(j, i + 1) = ThisWorkbook.Sheets(dataEx.Cells(1, i).Value).Cells(2, rng.Column).Value
j = j + 1
End If
skipCol:
End If
総レス数 1004
273 KB
新着レスの表示
掲示板に戻る
全部
前100
次100
最新50
read.cgi ver.24052200