Excel精英培训网

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

如何根据客户自动累加

[复制链接]
发表于 2017-10-17 17:27 | 显示全部楼层 |阅读模式
应收11.zip (32.79 KB, 下载次数: 11)
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2017-10-18 11:30 | 显示全部楼层
  1. Sub aaa()
  2. Dim i&, r&, c&
  3. If [b8] = "" Then MsgBox "No Data!": Exit Sub
  4. With Sheets(3)
  5.   For i = 8 To 14
  6.     If Cells(i, 2) = "" Then Exit For
  7.     r = .Columns(1).Find(Cells(i, 2)).Row
  8.     c = .Rows(3).Find(Left(Cells(i, 5), 2)).Column
  9.     .Cells(r, c + 1) = Cells(i, 4)
  10.     .Cells(r, c + 2) = .Cells(r, c) - Cells(i, 4)
  11.   Next i
  12. End With
  13. End Sub
复制代码
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-19 09:45 , Processed in 0.152672 second(s), 11 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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