選單圖示

zhuhe

典藏資源

勸學新篇

學試算表




山東巡撫 孫氏奏

為處理西洋字母大小寫

方式一

將範圍內所有文字都變更為大寫字母的巨集


Sub Uppercase()

' Loop to cycle through each cell in the specified range.

For Each x In Range("A1:A5")

' Change the text in the range to uppercase letters.

x.Value = UCase(x.value)

Next

End Sub


方式二

將範圍內所有文字都變更為小寫字母的巨集


Sub Lowercase()

' Loop to cycle through each cell in the specified range.

For Each x In Range("B1:B5")

x.Value = LCase(x.Value)

Next

End Sub


方式三

將資料格範圍內所有文字都變更為字首大寫字母的巨集


Sub Proper_Case()

' Loop to cycle through each cell in the specified range.

For Each x In Range("C1:C5")

' There is not a Proper function in Visual Basic for Applications.

' So, you must use the worksheet function in the following form:

x.Value = Application.Proper(x.Value)

Next

End Sub


參考一

微軟官方三種方式

參考二

根據首字母轉換

參考三

電腦軟體教學

參考四

擴展

處理西洋字母僅恭摺具

奏伏乞

皇上聖鑒謹

知道了

成憲庚子年五月廿五日