Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 2361|回复: 2

[已解决]求代码!!!

[复制链接]
发表于 2015-7-8 16:54 | 显示全部楼层 |阅读模式
又来请前辈们帮忙了。:)
最佳答案
2015-7-8 20:47
Sub Start()
    For i = 2 To 601
        For j = 7 To 16
            If Cells(i, "C") Like Cells(1, j) Then
                'Cells(i, "b").Copy Cells(i, j)
                Cells(i, j) = "中"
            Else
                If i >= 3 Then Cells(i, j) = IIf(Cells(i - 1, j) = "中", 0, Cells(i - 1, j)) + 1
            End If
        Next
    Next
End Sub

222.rar

39.71 KB, 下载次数: 30

发表于 2015-7-8 20:47 | 显示全部楼层    本楼为最佳答案   
Sub Start()
    For i = 2 To 601
        For j = 7 To 16
            If Cells(i, "C") Like Cells(1, j) Then
                'Cells(i, "b").Copy Cells(i, j)
                Cells(i, j) = "中"
            Else
                If i >= 3 Then Cells(i, j) = IIf(Cells(i - 1, j) = "中", 0, Cells(i - 1, j)) + 1
            End If
        Next
    Next
End Sub
回复

使用道具 举报

 楼主| 发表于 2015-7-9 11:24 | 显示全部楼层
wp8680 发表于 2015-7-8 20:47
Sub Start()
    For i = 2 To 601
        For j = 7 To 16

问题解决,感谢WP8680!!!!!!!!!!!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-19 22:46 , Processed in 0.287743 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表