- 日志
- 好友
- 卖家信用
- 买家信用
- 注册时间
- 2006-2-22
- 在线时间
- 小时
|
楼主 |
发表于 2011-12-17 14:13:41
|
显示全部楼层
sundf 发表于 2011-12-17 00:31
我不知道你想要的动态名字是啥,所以给你的例子是form输入。至于其他,应该满足要求了,if的写法看代码啦 ... - Private Sub CommandButton1_Click()
- Dim m As Integer
- Dim n As Integer
- Dim f As Integer
- Dim i, j As Integer
- Sheets("Practice data").Select
- Sheets("Practice data").Copy After:=Sheets("Practice data")
- ActiveSheet.Name = TextBox1.Text
- ActiveCell.CurrentRegion.Select
- n = Selection.Columns.count
- m = Selection.Row.count
- f = n - Descolumncount
- For i = 2 To m
- For j = 2 To f
-
- If CDbl(Sheets("remark").Cells(i, j)) >= CDbl(TextBox2.Text) Then
- Sheets(TextBox1.Text).Cells(i, j) = Sheets("Practice data").Cells(i, j)
- Else
- Sheets(TextBox1.Text).Cells(i, j) = 0
- End If
- Next i
- Next j
- End Sub
复制代码 改完的,next i 那里出错了。。。。
|
|