ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

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

[求助] 判断最后一个单元格为空值,为什么明明是空的,判断为不为空

[复制链接]

TA的精华主题

TA的得分主题

发表于 2020-3-16 12:04 | 显示全部楼层 |阅读模式
x = .Range("d65536").End(xlUp).Row + 1判断最后一个单元格为空值,为什么明明是空的,判断为不为空,打单生成的记录 就每一单 都要空几行无法紧挨着,是什么原因了,感谢各位帮忙看看!

代码如下:
Sub 打单保存()

'

' 打单保存 Macro

'

'Sheets("打单系统").Select

With Sheets("打单明细表")

  x = .Range("d65536").End(xlUp).Row + 1

  For i = 0 To 15

     .Cells(x + i, 4) = Cells(i + 29, 30)

     .Cells(x + i, 5) = Cells(i + 29, 31)

     .Cells(x + i, 6) = Cells(i + 29, 32)

     .Cells(x + i, 7) = Cells(i + 29, 33)

     .Cells(x + i, 8) = Cells(i + 29, 34)

     .Cells(x + i, 9) = Cells(i + 29, 35)

     .Cells(x + i, 10) = Cells(i + 29, 36)

     .Cells(x + i, 11) = Cells(i + 29, 37)

     .Cells(x + i, 12) = Cells(i + 29, 38)

     .Cells(x + i, 13) = Cells(i + 29, 39)

     .Cells(x + i, 14) = Cells(i + 29, 40)

     .Cells(x + i, 15) = Cells(i + 29, 41)

     .Cells(x + i, 16) = Cells(i + 29, 42)

     .Cells(x + i, 17) = Cells(i + 29, 43)

     .Cells(x + i, 18) = Cells(i + 29, 44)

     .Cells(x + i, 19) = Cells(i + 29, 45)

     .Cells(x + i, 20) = Cells(i + 29, 46)

     .Cells(x + i, 21) = Cells(i + 29, 47)

     .Cells(x + i, 22) = Cells(i + 29, 48)

     .Cells(x + i, 23) = Cells(i + 29, 49)

     .Cells(x + i, 24) = Cells(i + 29, 50)

     .Cells(x + i, 25) = Cells(i + 29, 51)

     .Cells(x + i, 26) = Cells(i + 29, 52)

     .Cells(x + i, 27) = Cells(i + 29, 53)

     .Cells(x + i, 28) = Cells(i + 29, 54)

     .Cells(x + i, 29) = Cells(i + 29, 55)

     .Cells(x + i, 30) = Cells(i + 29, 56)

     .Cells(x + i, 31) = Cells(i + 29, 57)

     .Cells(x + i, 32) = Cells(i + 29, 58)

     .Cells(x + i, 33) = Cells(i + 29, 59)

     .Cells(x + i, 34) = Cells(i + 29, 60)

     .Cells(x + i, 35) = Cells(i + 29, 61)

     .Cells(x + i, 36) = Cells(i + 29, 62)

     .Cells(x + i, 37) = Cells(i + 29, 63)

     .Cells(x + i, 38) = Cells(i + 29, 64)


Next

End With

Range("m23,q23,a29:f31,o29:v31,b25,b26,g25,g26,m25,m26,v25,u33,b34").ClearContents

  s = Range("v22")

Range("v22") = Left(s, 3) & Right("0000" & Right(s, 10) + 1, 10)

MsgBox "保存完毕", , "提示"

End Sub


TA的精华主题

TA的得分主题

 楼主| 发表于 2020-3-16 12:05 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
image.png
image.png
生成的单据不是紧挨着的

TA的精华主题

TA的得分主题

 楼主| 发表于 2020-3-16 12:06 | 显示全部楼层
附件我传一个

kaidan-2.zip

83.39 KB, 下载次数: 3

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

本版积分规则

关闭

最新热点上一条 /1 下一条

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

GMT+8, 2024-4-26 09:14 , Processed in 0.029495 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

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

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

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