永发信息网

ExcelVBA怎么获得最大字符长度

答案:2  悬赏:50  手机版
解决时间 2021-02-25 22:08
  • 提问者网友:你独家记忆
  • 2021-02-24 23:06
如果把单个中文字符的长度算做2,单个英文字符和数字字符的长度算做1
怎么样能快速找到一列中字符总长最大的单元格?
一列可能有上万行,有没有快速有效的方法
最佳答案
  • 五星知识达人网友:妄饮晩冬酒
  • 2021-02-25 00:46
试试用
MsgBox Application.WorksheetFunction. 来调用Excel函数
MsgBox Application.WorksheetFunction.{match(max(lenb(A1:100),lenb(A1:100),0)}
全部回答
  • 1楼网友:琴狂剑也妄
  • 2021-02-25 01:24
sub macro1() dim xrng as range, firstrng as range if left(range("a1"), 3) = "d1[" then set firstrng = range("a1") else set firstrng = cells.find("d1[") end if set xrng = cells.find("d1[", firstrng) if xrng is nothing then msgbox "没有了" else msgbox xrng.row end if end sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯