excel用VBA将文本字符串的首字母变成大写
时间:2022-08-04 00:01:28
下面的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,用,VBA,将,文本,字符串,的,首,字母,变成
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Office2010升级Office2016时提示1714错误该怎么办?
2023-08-27 16:09:44
![](https://img.aspxhome.com/file/2023/1/15831_0s.jpg)
Excel表格怎么设置自动换行?
2022-10-20 11:46:59
![](https://img.aspxhome.com/file/2023/9/a154039_0s.jpg)
Word怎么做斜着的机密水印
2022-11-11 02:17:22
![](https://img.aspxhome.com/file/2023/6/32026_0s.png)
excel 如何利用公式设置数据验证条件
2022-05-22 01:50:23
![](https://img.aspxhome.com/file/2023/1/a154621_0s.jpg)
WPS2013版,怎么把多个文档合并成一个文档里?
2023-09-14 11:28:21
![](https://img.aspxhome.com/file/2023/7/a163587_0s.png)
Word如何在文本右上角加上数字
2022-10-23 02:41:00
![](https://img.aspxhome.com/file/2023/7/31627_0s.png)
怎样解决Excel套用表格样式后不能合并
2022-12-12 20:29:16
![](https://img.aspxhome.com/file/2023/9/38099_0s.png)
在Excel表格中如何将内容快速转移到新表格中
2022-02-13 19:53:26
![](https://img.aspxhome.com/file/2023/5/43175_0s.jpg)
excel 双页的多重合并计算数据透视表的方法
2022-04-17 18:40:12
![](https://img.aspxhome.com/file/2023/0/a155280_0s.gif)
Word中设置前几页不要页眉页脚的操作方法
2022-09-12 01:18:29
iOS 14.5 beta 8已发布,附更新内容及升级方法
2023-11-04 00:44:35
![](https://img.aspxhome.com/file/2023/2/46012_0s.png)
office 2010 手动卸载和安装提示基础教程
2023-11-07 21:36:36
![](https://img.aspxhome.com/file/2023/1/16681_0s.jpg)
word组合功能怎么用?word图片组合方法介绍
2022-02-04 09:35:09
![](https://img.aspxhome.com/file/2023/8/25808_0s.png)
word中如何插入矩阵?
2023-11-24 16:21:56
![](https://img.aspxhome.com/file/2023/7/17807_0s.png)
怎样在EXCEL中输入拼音字母g和a
2022-09-13 10:12:01
![](https://img.aspxhome.com/file/2023/5/36725_0s.png)
Excel2013工作表怎么给数据设置千元的单位?
2022-12-29 17:49:30
![](https://img.aspxhome.com/file/2023/7/42157_0s.jpg)
Excel表格怎么做文件夹侧标签? 文件夹侧标签的设计方法
2022-03-22 05:36:54
![](https://img.aspxhome.com/file/2023/8/39838_0s.jpg)
如何在Word 2019中选择表格样式?
2022-08-17 11:20:27
如何在excel2019中创建和修改数据透视表
2022-07-31 06:58:24
![](https://img.aspxhome.com/file/2023/7/a140257_0s.jpg)
在word中如何画图?Word画图方法大全
2023-11-27 16:09:54