Excel精英培训网

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

[已解决]请老师帮我修改代码

[复制链接]
发表于 2016-2-13 21:26 | 显示全部楼层 |阅读模式
请老师再帮我修改代码,表三工作表里的I6和I9单元格;I6=F6*0.6;
              I9=F9*0.6
I7和I8单元格:I7=F7*0.1
              I8=F7*0.1
I10:I30区域单元格都是*0.6
最佳答案
2016-2-13 22:12
本帖最后由 scl5801 于 2016-2-13 22:14 编辑

Sub test()
    Dim i&
    With Sheets("表一")
        For i = 6 To .[b65536].End(3).Row
            .Cells(i, "j") = .Cells(i, "i") * .Cells(i, "f")
            .Cells(i, "k") = .Cells(i, "h") - .Cells(i, "j")
        Next
    End With
    With Sheets("表二")
        For i = 6 To .[b65536].End(3).Row
            .Cells(i, "i") = .Cells(i, "f") * 0.6
            .Cells(i, "k") = .Cells(i, "j") * .Cells(i, "i")
            .Cells(i, "l") = .Cells(i, "h") - .Cells(i, "k")
        Next
    End With
    With Sheets("表三")
        For i = 6 To .[b65536].End(3).Row
            .Cells(i, "i") = .Cells(i, "f") * 0.6
            .Cells(i, "k") = .Cells(i, "j") * .Cells(i, "i")
            .Cells(i, "l") = .Cells(i, "h") - .Cells(i, "k")
        Next
        .Cells(7, "i") = .Cells(7, "f") * 0.1
        .Cells(8, "i") = .Cells(7, "f") * 0.1
    End With
End Sub

清算01.rar

43.89 KB, 下载次数: 5

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2016-2-13 22:12 | 显示全部楼层    本楼为最佳答案   
本帖最后由 scl5801 于 2016-2-13 22:14 编辑

Sub test()
    Dim i&
    With Sheets("表一")
        For i = 6 To .[b65536].End(3).Row
            .Cells(i, "j") = .Cells(i, "i") * .Cells(i, "f")
            .Cells(i, "k") = .Cells(i, "h") - .Cells(i, "j")
        Next
    End With
    With Sheets("表二")
        For i = 6 To .[b65536].End(3).Row
            .Cells(i, "i") = .Cells(i, "f") * 0.6
            .Cells(i, "k") = .Cells(i, "j") * .Cells(i, "i")
            .Cells(i, "l") = .Cells(i, "h") - .Cells(i, "k")
        Next
    End With
    With Sheets("表三")
        For i = 6 To .[b65536].End(3).Row
            .Cells(i, "i") = .Cells(i, "f") * 0.6
            .Cells(i, "k") = .Cells(i, "j") * .Cells(i, "i")
            .Cells(i, "l") = .Cells(i, "h") - .Cells(i, "k")
        Next
        .Cells(7, "i") = .Cells(7, "f") * 0.1
        .Cells(8, "i") = .Cells(7, "f") * 0.1
    End With
End Sub
回复

使用道具 举报

 楼主| 发表于 2016-2-13 22:40 | 显示全部楼层
scl5801 发表于 2016-2-13 22:12
Sub test()
    Dim i&
    With Sheets("表一")

  .Cells(8, "i") = .Cells(8, "f") * 0.1
OK,祝老师过年开心快乐,谢谢老师!!!!
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-15 04:38 , Processed in 0.246202 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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