如图例:
C1=INDEX(A:A,COUNTA(A:A)-ROW(A1)+1)
或=OFFSET(A$1,COUNTA(A:A)-ROW(A1),)
下拉
Sub xx()Dim i, j, n1, n2, n3, n4, d
Set d = CreateObject("ScriptingDictionary")
For i = 11 To 26
n1 = Cells(4 ^ 8, i)End(3)Row
n2 = Cells(n1, i)End(3)Row
n3 = Cells(n2, i)End(3)Row
n4 = Cells(n3, i)End(3)Row
For j = n4 To n3
If Cells(j, i)InteriorColorIndex <> xlNone Then
d(Cells(j, i)Text) = ""
End If
Next
If dCount >= 3 Then '在这里修改
If Cells(n3, i) > Cells(n3 - 1, i) Then
For j = n2 To n1
If Cells(j, i) < Cells(n3, i) Then
Cells(j, i)InteriorColorIndex = 3
End If
Next
ElseIf Cells(n3, i) < Cells(n3 - 1, i) Then
For j = n2 To n1
If Cells(j, i) > Cells(n3, i) Then
Cells(j, i)InteriorColorIndex = 3
End If
Next
End If
End If
dRemoveAll
Next
End Sub
1、对该单元格进行“数据”选项下的“分列”,以-作为分隔符分列,并忽略空列,得到名称;
2、在A2单元格输入以下公式,然后向右填充公式,得到名称的逆序排列;
=INDEX($A1:$E1,5-COLUMN(A1)+1)
3、复制第二行,并选择性粘贴为“数值”;
4、复制“数值”所在单元格,并选择性粘贴为“转置”;
5、在单元格旁添加--,然后输入=PHONETIC(A5:B9),即可得到逆序排列的单元格内容。
详见附图
Sub s()Dim rg As Range, rng As Range
Set rg = [g11:s22]
For Each rng In rg
If rngInteriorColorIndex = xlNone Then
rngInteriorColorIndex = 33
Else
rngInteriorColorIndex = xlNone
End If
Next
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)