Dim c As Variant
If TypeName(selection)<>"Range" Then Exit Sub
For Each c In Selection
c.offset(0,1)=c.Value*2
Next
Dim hida As Long
Dim migi As Long
For migi=2 To 11
For hida=2 To 21
If Range(F,migi).Value=Range(B,hida).Value Then
Range(C,hida).Value="OK"
Exit For
End If
Next
Next
Dim i As Long
For i=2 to 13
If workshhet Function.CountIf(Range("A:A"),Cells(i,"C"))>1 Then
Cells(i,"D")="重複"
Next
Dim tate As Long
Dim rM As Range
Dim st() As Variant
For tate=0 to 19
ReDim preserve st(tate)
st(tate)=Range("F2").offset(tate).Value
Next
For tate=0 to UBound(st)
For Each rM In Range("B2:B1001")
If rM.Value=st(tate)Then
rM.offset(,1).Value="OK"
End if
Next
Next
Dim rM As Range
Dim rH As Range
Dim rMy As Range
Dim rFirst As Range
For Each rM In Range("F2:F21")
Set rH=Range("B1:B100001")
Set rMy=rH.Find(what:=rM.Value)
If rMy Is Nothing Then Exit for
Else
Set rFirst=rMy
rMy.offset(,1).Value="OK"
End If
Do
Set rMy=rH.Find Next(rMy)
If rMy.Address=rFirst.Address Then Exit Do
Else
rMy.offset(,1).Value="OK"
End If
Loop
Next
WorksheetFunction.CountIf(Range("B3:B6"),"OK")
For i=1 To UBound(A,1)
If A(i,1)="イトウ" Then
Debug.Print"イトウは、No"& A(i,1)&"です
End If
Next
Dim tRng As Range
For Each tRng In selection
tRng.Value=tRng.Value &"支店"
Next
Dim tRow As Range
For Each tRow In Range("B3:D8").Rows
If tRow.cells(2).Value="和菓子"Then
tRow.cells(3).Value=tRow.cells(3).Value-20
Next
If Activecell>0 Then
If Activecell>5 Then MsgBox"Big"
Else
If Activecell<0 Then MsgBox"Minus"
End If
Selectcase Activecell
Case 1 to 5
MsgBox"範囲内"
Case Is>10
MsgBox"大きい"
Case 7,9
MsgBox"奇数"
Case Else
MsgBox"それ以外"
End Select