ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
楼主: hzg7818

[分享] Excel实现明细帐的示例

[复制链接]

TA的精华主题

TA的得分主题

发表于 2005-8-11 21:40 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
谢谢!

TA的精华主题

TA的得分主题

发表于 2005-8-18 04:01 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2005-11-16 20:14 | 显示全部楼层
谁能写一个13栏明细帐的模板,绝对N多个人会去下载,估计没有吧?????[em08]

TA的精华主题

TA的得分主题

发表于 2005-12-14 12:28 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
haohaoyanjiu

TA的精华主题

TA的得分主题

发表于 2005-12-14 15:00 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
<P>  相当不错,谢谢楼主!</P>

TA的精华主题

TA的得分主题

发表于 2005-12-15 09:14 | 显示全部楼层
感觉好深,看不懂,不过是这种方向

TA的精华主题

TA的得分主题

发表于 2006-1-1 20:37 | 显示全部楼层
以下是引用[I]hzg7818[/I]在2004-2-25 18:35:00的发言:[BR]这个示例仅仅说明从财务软件取数生成账簿的方法,实际很多财务软件也是这样做的,采用Ado或Dao等数据访问组件,从后台数据库提取数据,然后生成所需格式的报表等等,由于仅仅是个示例,离实际应用需要丰富和完善的功能还相差很多,如果大家需要在实际工作中应用的话,必须先掌握一定的Sql语句、ado对象的使用方法,不过这些也都是必须使用vba的,当然vba的语法方面也需过关,如果这些方法不会没关系,可以多看微软自带的帮助示例代码,相信很快就可以掌握的。


使用Excel的数据透视表等工具也可以实现明细帐,在这个方面深入研究的确是掌握Excel的绝佳方式,但财务软件都是基于数据库的,要将Excel与财务软件结合在一起使用,使用Ado和Sql语句是必经之路,各位财会同仁如果对Ado等没有过接触的,不妨在这方面下一些功夫。


由于Excel天然的所见即所得的功能以及Ado良好的适应性,这两个工具结合使用会胜过很多财务软件的报表、账簿打印模块,相信大家都可以做的到!


附:ado的帮助文件ado210.chm,jet引擎的sql帮助文件Jetsql.chm,这两个文件安装完全的office一般都带,各位需要的朋友自己搜索一下。

PFPF!五体投地
[em17]

TA的精华主题

TA的得分主题

发表于 2006-1-4 22:26 | 显示全部楼层

请教版主

年初借用了龙逸凡的账务处理记账,但由于是用Excel做的,数据多了速度很慢(凭证分录有10000多行),虽然能查阅各类账目,但没有明细账页的打印(根椐手工记账的规定需要账页),现已到了年底,所有的明细账都没有记,真是急死了,看了版主的明细账实例,真是佩服,不知版主能否帮忙。原来是用Excel的后来想学习版主的的方法就导出到了Access数据库,但对于版主的宏命令无法参悟,所以无法自己完成。希望版主帮忙,先在此谢过了。

TyC77BnJ.rar (69.33 KB, 下载次数: 147)

TA的精华主题

TA的得分主题

发表于 2006-1-5 15:30 | 显示全部楼层
<P>说的都是精华。有必要进一步学习。</P>

TA的精华主题

TA的得分主题

发表于 2006-1-24 11:33 | 显示全部楼层
<P>前一段时间完成了应收账款明细账查询,前提是所有数据都在excel中,用excel做数据库,缺点:速度太慢</P>
<P>Sub LookupAR()<BR>Dim FinalRow As Integer<BR>Dim FinalColumn As Integer<BR>Dim DataBase As Range<BR>Dim FlagRange As Range<BR>Dim MonthRange As Range<BR>Dim AimRange As Range<BR>Dim CriteriaRange As Range<BR>Dim ORange As Range<BR>Dim StartTime<BR>Dim FinishTime</P>
<P>Application.ScreenUpdating = False<BR>StartTime = Timer</P>
<P>'假定明细帐最多2000行</P>
<P><BR>Range(Cells(7, 1), Cells(2006, 20)).Delete<BR>Range("i1:iv1").EntireColumn.Delete<BR>FinalColumn = Range("iv4").End(xlToLeft).Column<BR>Debug.Print FinalColumn<BR>Cells(6, 4) = "上年结转"<BR>Cells(6, 8).Formula = "=if(iserror(VLOOKUP(C2,BeginningAmount,2,FALSE)),0,VLOOKUP(C2,BeginningAmount,2,FALSE))"<BR>Cells(6, 8) = Cells(6, 8).Value<BR>With Worksheets("凭证录入")</P>
<P>Cells(1, FinalColumn + 3).Resize(1, 5) = Array(.Cells(4, 3), .Cells(4, 4), .Cells(4, 5), .Cells(4, 8), .Cells(4, 9))</P>
<P>End With</P>
<P>Set ORange = Cells(1, FinalColumn + 3).Resize(1, 5)</P>
<P>Range("pzlr").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _<BR>"ARCriteria"), CopyToRange:=ORange, Unique:=False<BR>ORange.EntireColumn.Select<BR>Selection.Columns.AutoFit<BR>Selection.Font.Size = 9</P>
<P>'设计本月合计、累计</P>
<P>Dim AimRow As Integer<BR>Dim FlagRow As Integer<BR>Dim FlagColumn As Integer<BR>Dim TotalCreditMonth As Currency<BR>Dim TotalDebitMonth As Currency<BR>Dim TotalCreditYear As Currency<BR>Dim TotalDebitYear As Currency<BR>AimRow = 7: FlagRow = 2: FlagColumn = 11<BR>Do While Cells(FlagRow, FlagColumn) &lt;&gt; ""<BR>    TotalDebitYear = TotalDebitYear + Cells(FlagRow, FlagColumn + 3)<BR>    TotalCreditYear = TotalCreditYear + Cells(FlagRow, FlagColumn + 4)<BR>    <BR>    If Cells(FlagRow + 1, FlagColumn) &lt;&gt; "" And Month(Cells(FlagRow, FlagColumn)) &lt;&gt; Month(Cells(FlagRow + 1, FlagColumn)) Then<BR>        <BR>        <BR>            Cells(AimRow, 1) = Month(Cells(FlagRow, FlagColumn))<BR>            Cells(AimRow, 2) = Day(Cells(FlagRow, FlagColumn))<BR>            Cells(FlagRow, FlagColumn + 1).Resize(1, 4).Copy Destination:=Cells(AimRow, 3)<BR>            Cells(AimRow + 1, 3) = "本月合计"<BR>            Cells(AimRow + 2, 3) = "累计"<BR>            If Cells(AimRow + 1, 3) = "本月合计" Then<BR>                 Cells(AimRow + 1, 5) = Cells(FlagRow, FlagColumn + 3) + TotalDebitMonth<BR>                 Cells(AimRow + 1, 6) = Cells(FlagRow, FlagColumn + 4) + TotalCreditMonth<BR>                 TotalDebitMonth = 0: TotalCreditMonth = 0<BR>                 Cells(AimRow + 2, 5) = TotalDebitYear<BR>                 Cells(AimRow + 2, 6) = TotalCreditYear<BR>              <BR>            End If<BR>            <BR>            AimRow = AimRow + 2<BR>            <BR>        <BR>    Else<BR>            Cells(AimRow, 1) = Month(Cells(FlagRow, FlagColumn))<BR>            Cells(AimRow, 2) = Day(Cells(FlagRow, FlagColumn))<BR>            Cells(FlagRow, FlagColumn + 1).Resize(1, 4).Copy Destination:=Cells(AimRow, 3)<BR>            TotalCreditMonth = TotalCreditMonth + Cells(FlagRow, FlagColumn + 4)<BR>            TotalDebitMonth = TotalDebitMonth + Cells(FlagRow, FlagColumn + 3)<BR>            <BR>            <BR>    End If<BR>    <BR>    AimRow = AimRow + 1<BR>    FlagRow = FlagRow + 1<BR>Loop<BR>Cells(AimRow, 3) = "本月合计"<BR>Cells(AimRow + 1, 3) = "累计"<BR>Cells(AimRow, 5) = TotalDebitMonth<BR>Cells(AimRow, 6) = TotalCreditMonth<BR>Cells(AimRow + 1, 5) = TotalDebitYear<BR>Cells(AimRow + 1, 6) = TotalCreditYear<BR>Range("a6").Select<BR>FinalRow = [c65536].End(xlUp).Row<BR>Set region = Range("a6").Resize(FinalRow - 5, 8)<BR>irow = 7<BR>Do While Cells(irow, 3) &lt;&gt; ""<BR>    If Cells(irow, 3) = "本月合计" Or Cells(irow, 3) = "累计" Then<BR>        Cells(irow, 8).Value = Cells(irow - 1, 8)<BR>    <BR>    Else<BR>        Cells(irow, 8).Value = Cells(irow - 1, 8) + Cells(irow, 5) - Cells(irow, 6)<BR>    End If<BR>    If Cells(irow, 8).Value &gt; 0 Then<BR>        Cells(irow, 7) = "借"<BR>    Else<BR>        If Cells(irow, 8).Value = 0 Then<BR>           Cells(irow, 7) = "平"<BR>        Else<BR>           Cells(irow, 7) = "贷"<BR>        End If<BR>    End If<BR>    <BR>    irow = irow + 1<BR>Loop<BR> region.RowHeight = 15<BR> <BR>    With region<BR>        .HorizontalAlignment = xlLeft<BR>        .VerticalAlignment = xlBottom<BR>        .WrapText = False<BR>        .Orientation = 0<BR>        .AddIndent = False<BR>        .IndentLevel = 0<BR>        .ShrinkToFit = False<BR>        .ReadingOrder = xlContext<BR>        .MergeCells = False<BR>    End With<BR>    region.Borders(xlDiagonalDown).LineStyle = xlNone<BR>    region.Borders(xlDiagonalUp).LineStyle = xlNone<BR>    With region.Borders(xlEdgeLeft)<BR>        .LineStyle = xlContinuous<BR>        .Weight = xlThin<BR>        .ColorIndex = 5<BR>    End With<BR>    With region.Borders(xlEdgeTop)<BR>        .LineStyle = xlContinuous<BR>        .Weight = xlThin<BR>        .ColorIndex = 5<BR>    End With<BR>    With region.Borders(xlEdgeBottom)<BR>        .LineStyle = xlContinuous<BR>        .Weight = xlThin<BR>        .ColorIndex = 5<BR>    End With<BR>    With region.Borders(xlEdgeRight)<BR>        .LineStyle = xlContinuous<BR>        .Weight = xlThin<BR>        .ColorIndex = 5<BR>    End With<BR>    With region.Borders(xlInsideVertical)<BR>        .LineStyle = xlContinuous<BR>        .Weight = xlThin<BR>        .ColorIndex = 5<BR>    End With<BR>    With region.Borders(xlInsideHorizontal)<BR>        .LineStyle = xlContinuous<BR>        .Weight = xlThin<BR>        .ColorIndex = 5<BR>    End With<BR>    <BR>'返回程序运行时间<BR>FinishTime = Timer<BR>MsgBox "应收账款----" &amp; Cells(2, 3).Value &amp; Chr(13) &amp; Chr(10) &amp; "明细帐查询共用了:" &amp; Chr(13) &amp; Chr(10) &amp; FinishTime - StartTime &amp; "秒"<BR>Application.ScreenUpdating = True</P>
<P>region.Columns("h").NumberFormatLocal = "#,##0.00_ "<BR>Range("k1:iv1").EntireColumn.Delete<BR>End Sub</P>
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-5-21 18:25 , Processed in 0.044403 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

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