当サイトはアフィリエイト広告を利用しています。Amazonアソシエイト参加者

[VBA]マス比較

Microsoft系(VBAなど)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Private Sub onajika()
    Dim i As Integer
    Dim j As Integer
    Dim cnt As Integer
    cnt = 1
    Dim tt As Integer
    tt = 0
    Dim wk As Integer
    wk = 1
    For i = 1 To 102 'Worksheets(wk).Cells.Count
        tt = 0
        For j = 1 To 102 'Worksheets(wk).Cells.Count
            If Worksheets(wk).Cells(i, 1).Value = Worksheets(wk).Cells(j, 2) Then
                tt = 1
                Exit For
            End If
        Next
        If tt = 0 Then
           Worksheets(wk).Range("C" & i).Value = Worksheets(wk).Cells(i, 1).Value
           Worksheets(wk).Range("D" & cnt).Value = Worksheets(wk).Cells(i, 1).Value
           cnt = cnt + 1
        End If
    Next
End Sub

更新@2011.03.03 22:43

コメント

タイトルとURLをコピーしました