|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub aCase()
- Dim myRng As Range, mySht As Worksheet, Cat, aName
- Cat = Cells(8, 5).Text
- Set mySht = Sheets(Cat)
- Set myRng = mySht.Columns(2).Find("否", lookat:=xlWhole)
- If myRng Is Nothing Then MsgBox Cat & "已无未使用的激活码!": Exit Sub
- aName = InputBox("请填入使用人:")
- mySht.Cells(myRng.Row, 2) = "是"
- mySht.Cells(myRng.Row, 4) = aName
- mySht.Cells(myRng.Row, 5) = Date
- Cells(13, 5) = mySht.Cells(myRng.Row, 3).Text
- End Sub
复制代码
个人觉得find比遍历快一些 |
评分
-
1
查看全部评分
-
|