Excel精英培训网

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

[已解决]三个单元只要一个为空就不执行公式运算

[复制链接]
发表于 2022-12-9 19:31 | 显示全部楼层 |阅读模式
3学分
本帖最后由 15968725770 于 2022-12-9 21:54 编辑

三个单元只要一个为空就不执行公式运算
最佳答案
2022-12-9 19:31
sub demo()
   a=[b4:r11]
   for i = 1 to ubound(a)
      a(i,17)=""
      if a(i,3)<>"" and a(i,10)<>"" and a(i,11)<>"" then
         a(i,17)=INT((a(i,1)-SQRT(a(i,1)^2-4*((a(i,11)/a(i,10))/0.02491/(a(i,3)/1000))))/2*1000)/1000
      end if
   next
   [b4:r11]=a
end sub

三个单元只要一个为空就不执行公式运算.rar

12.31 KB, 下载次数: 6

三个单元只要一个为空就不执行公式运算

最佳答案

查看完整内容

sub demo() a= for i = 1 to ubound(a) a(i,17)="" if a(i,3)"" and a(i,10)"" and a(i,11)"" then a(i,17)=INT((a(i,1)-SQRT(a(i,1)^2-4*((a(i,11)/a(i,10))/0.02491/(a(i,3)/1000))))/2*1000)/1000 end if next =a end sub
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2022-12-9 19:31 | 显示全部楼层    本楼为最佳答案   
sub demo()
   a=[b4:r11]
   for i = 1 to ubound(a)
      a(i,17)=""
      if a(i,3)<>"" and a(i,10)<>"" and a(i,11)<>"" then
         a(i,17)=INT((a(i,1)-SQRT(a(i,1)^2-4*((a(i,11)/a(i,10))/0.02491/(a(i,3)/1000))))/2*1000)/1000
      end if
   next
   [b4:r11]=a
end sub

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-29 20:40 , Processed in 0.274603 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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