- 日志
- 好友
- 卖家信用
- 买家信用
- 注册时间
- 2006-2-22
- 在线时间
- 小时
|
楼主 |
发表于 2011-12-20 16:09:03
|
显示全部楼层
本帖最后由 陈酿 于 2011-12-20 16:09 编辑
sundf 发表于 2011-12-18 22:11
Sheets("Practice data").Copy After:=Sheets("Practice data")
换成
Sheets("Practice data").Copy Afte ...
上个回复不用看了。发现了新的问题,我把orginal的 换成 Sorting之后代码 If CDbl(Sheets("remark").Cells(i, j)) >= CDbl(TextBox1.Text) Then
Sheets(TextBox1.Text).Cells(i, j) = Sheets("Sorting").Cells(i, j) 这句貌似没有运行,直接把表复制过去,没有进行对0的替换 - Private Sub CommandButton1_Click()
- Dim r As Integer
- Dim n As Integer
- Dim f As Integer
- Dim i, j As Integer
- Sheets("Sorting").Select
- Sheets("Sorting").Copy After:=Sheets("Sorting")
- ActiveSheet.Name = TextBox1.Text
- ActiveCell.CurrentRegion.Select
- n = Selection.Columns.count
- r = Selection.Rows.count
- f = n - Descolumncount
- For i = 2 To m
- For j = 2 To f
-
- If CDbl(Sheets("remark").Cells(i, j)) >= CDbl(TextBox1.Text) Then
- Sheets(TextBox1.Text).Cells(i, j) = Sheets("Sorting").Cells(i, j)
- Else
- Sheets(TextBox1.Text).Cells(i, j) = 0
- End If
- Next j
- Next i
-
- End Sub
复制代码 |
|