![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
VBA
柳瘦
大自然的搬运工
展开
-
VB-十进制切16进制;切割功能
Sub ffll()For i = 2 To 200 Step 1 a = Range("A" & i).Value b = Val(a) c = VBA.Hex(b) Range("B" & i).Value = c lenc = Len(c) - 11 splitdata = Mid(c, 8, 12) Range("C" & i).Value = splitdata Next iEnd Sub原创 2021-12-02 20:03:35 · 267 阅读 · 0 评论 -
VB-批量替换多重字段
Dim arrarr = array("a|11","b|22","c|3","d|f")file = "a.txt"Set fso = CreateObject("Scripting.FileSystemObject")Set f = fso.OpenTextFile(file, 1)txt = f.ReadAllf.CloseFor Each a In arr t = split(a, "|") txt = replace(txt, t(0), t(1))NextSet原创 2021-06-11 16:09:25 · 480 阅读 · 1 评论 -
VBA-EXCEL统计数据
考点1:行号获取考点2:三目运算符Sub ffll()ret0 = 0ret1 = 0Row = ActiveSheet.UsedRange.Rows.CountFor i = 2 To Row Step 1 k = Range("AJ" & i).Value If k > 0 Then k1 = IIf(Range("AL" & i).Valu...原创 2020-04-02 12:49:51 · 375 阅读 · 0 评论 -
VBA-EXCEL查找最后一个非空字符
=LOOKUP(1,0/(E18:W18<>""),E18:W18)Current列是效果图原创 2020-04-02 12:47:55 · 985 阅读 · 0 评论 -
VBA-EXCEL 对单元格的内容按行标序号
对单元格的内容按行标序号,通过VBA写如下代码实现:效果如下:Sub ffll()Dim kFor i = 1 To 10 Step 1 k = Range("A" & i).Value arr = Split(k, Chr(10)) For j = LBound(arr) To UBound(arr) ss = ss & j ss = s...原创 2020-02-12 20:13:56 · 952 阅读 · 0 评论