excel利用VBA将文本字符串的首字母变成大写
时间:2023-05-20 07:49:33
下面的VBA代码可以将活动工作表中的所有文本字符串的首字母改为大写,对包含公式单元格则不作更改。
Sub CapitalizeFirstLetter()
Dim Rng As Range
ActiveSheet.UsedRange.Select
For Each Rng In Selection.Cells
If Rng.HasFormula = False Then
Rng.Value = Application.WorksheetFunction.Proper(Rng.Value)
End If
Next Rng
End Sub
标签:利用,字符串,文本,首字母,Excel函数
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
MAC装Win10系统之后发热怎么办?MAC装Win10系统之后发热的解决方法
2023-12-02 06:40:15
![](https://img.aspxhome.com/file/2023/26/a219843_0s.jpg)
Win10怎么导入新字体?Win10字体安装教程
2022-12-31 09:53:13
![](https://img.aspxhome.com/file/2023/2/53002_0s.png)
如何在Word 2016中使用语法检查器?
2023-07-09 19:07:36
![](https://img.aspxhome.com/file/2023/4/23514_0s.jpg)
excel表格如何按顺序拉数
2023-09-29 16:47:38
excel表格百分比函数如何使用
2022-03-21 02:37:43
怎么在Win11注册表编辑器里添加新项?
2022-10-18 07:18:25
![](https://img.aspxhome.com/file/2023/30/a268506_0s.png)
Win10双显怎么切换到独显 win10切换显卡模式教程
2022-05-15 08:30:00
![](https://img.aspxhome.com/file/2023/28/a239242_0s.jpg)
如何安装Windows系统以ISO镜像文件为例
2022-07-13 00:53:38
![](https://img.aspxhome.com/file/2023/30/a262675_0s.jpg)
Word查找中通配符的用法
2023-12-09 21:19:42
![](https://img.aspxhome.com/file/2023/8/20198_0s.png)
电脑WPS文档阅读版式中如何显示批注
2022-06-02 05:45:00
![](https://img.aspxhome.com/file/2023/5/a183995_0s.png)
遇到生僻字 Word帮你学它的读法
2022-12-13 13:35:28
![](https://img.aspxhome.com/file/2023/8/21888_0s.jpg)
如何使用USB网卡上网?
2022-08-21 02:38:55
![](https://img.aspxhome.com/file/2023/3/a293397_0s.jpg)
IIS6.0不能上传大于200K文件解决办法
2022-09-01 19:07:47
win11系统512g怎么分盘?win11固态硬盘512g最佳分区教程
2023-07-13 14:48:55
![](https://img.aspxhome.com/file/2023/1/a272043_0s.jpg)
Win10卸载KB5007186发生错误,没有成功卸载全部更新怎么办?
2022-06-24 22:05:26
![](https://img.aspxhome.com/file/2023/25/a218935_0s.png)
使用图文集加入时间和页码的技巧
2023-10-12 11:41:33
chromium浏览器怎么卸载?chromium的卸载方法
2022-10-21 05:00:25
![](https://img.aspxhome.com/file/2023/7/a329784_0s.jpg)
Win10系统怎样打开PST格式文件
2022-01-19 06:31:16
![](https://img.aspxhome.com/file/2023/5/a313802_0s.jpg)
在word中数字上面的点怎么打?word数字上的点怎么输入教程
2022-07-28 17:39:42
![](https://img.aspxhome.com/file/2023/30/a268014_0s.jpg)
微软账号如何注册?
2022-03-18 07:53:08
![](https://img.aspxhome.com/file/2023/3/a293860_0s.jpg)