【问题标题】:Excel get/extract cap letter from cell to another cellExcel从单元格获取/提取大写字母到另一个单元格
【发布时间】:2016-10-22 05:10:16
【问题描述】:

如何将大写字母从一个单元格提取到另一个单元格

John Doe = JD

SomeWord = SW

ExTraCt = ETC

有没有关于这个的功能。我需要从 A 列到 B 列提取上限值。单元格仅包含文本值 + 空格(无数字,无特殊字符)

【问题讨论】:

标签: excel


【解决方案1】:

我找到了解决方案,但使用的是 VB。在普通模块中插入代码:

Function ExtractCap(Rng As Range)
Application.Volatile
ExtractCap = ""
For f = 1 To Len(Rng)
If Asc(Mid(Rng.Value, f, 1)) >= 65 And Asc(Mid(Rng.Value, f, 1)) <= 90 Then
ExtractCap = ExtractCap & Mid(Rng.Value, f, 1)
End If
Next f
End Function

然后使用这样的公式:

=ExtractCap(A1)

在 A1 中只显示大写字母。

参考:http://www.mrexcel.com/forum/excel-questions/230646-extract-capital-letters-text-cell.html#post1127820

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-29
    • 2016-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多