Excel精英培训网

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

[已解决]求用代码:将现金账余额运行

[复制链接]
发表于 2013-8-10 10:52 | 显示全部楼层 |阅读模式
用代码:将现金账余额运行
最佳答案
2013-8-10 11:30
Sub test()
    Dim s$, r%, i%
    Application.ScreenUpdating = False
    Sheets("现金日记帐").Select
    s = "本月合计,本月累计,累计,本年累计,过次页,承前页"
    r = Range("f65536").End(xlUp).Row
    For i = 6 To r
        If s Like "*" & Cells(i, "f") & "*" Then
            Cells(i, "m") = Cells(i - 1, "m")
        Else
            If Cells(i, "f") <> "" Then
                Cells(i, "m") = Cells(i - 1, "m") + Cells(i, "h") - Cells(i, "j")    'M5+H6-J6
            Else
                Cells(i, "m") = 0
            End If
        End If
    Next i
End Sub
用代码:将现金账余额运行2.rar (19.87 KB, 下载次数: 11)

用代码:将现金账余额运行.rar

12.79 KB, 下载次数: 7

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2013-8-10 11:30 | 显示全部楼层    本楼为最佳答案   
Sub test()
    Dim s$, r%, i%
    Application.ScreenUpdating = False
    Sheets("现金日记帐").Select
    s = "本月合计,本月累计,累计,本年累计,过次页,承前页"
    r = Range("f65536").End(xlUp).Row
    For i = 6 To r
        If s Like "*" & Cells(i, "f") & "*" Then
            Cells(i, "m") = Cells(i - 1, "m")
        Else
            If Cells(i, "f") <> "" Then
                Cells(i, "m") = Cells(i - 1, "m") + Cells(i, "h") - Cells(i, "j")    'M5+H6-J6
            Else
                Cells(i, "m") = 0
            End If
        End If
    Next i
End Sub
用代码:将现金账余额运行2.rar (19.87 KB, 下载次数: 11)

评分

参与人数 1 +1 收起 理由
我心飞翔410 + 1 很给力!

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-20 23:53 , Processed in 0.379148 second(s), 14 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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