|
Program to change to upper
case
Private Sub CommandButton1_Click()
Dim rng, cell As Range, selectedRng, cell_value As String
selectedRng = InputBox("Enter your range (Using the format
Ai:Aj)")
Set rng = Range(selectedRng)
For Each cell In rng
cell_value = UCase(cell.Value)
cell.Value = cell_value
Next cell
End Sub
Program to change to lower case
Private Sub CommandButton2_Click()
Dim rng, cell As Range, selectedRng, cell_value As String
selectedRng = InputBox("Enter your range (Using the format
Ai:Aj)")
Set rng = Range(selectedRng)
For Each cell In rng
cell_value = LCase(cell.Value)
cell.Value = cell_value
Next cell
End Sub
|
Program to
change to italic fonts
Private Sub
CommandButton3_Click()
Dim rng, cell As Range, selectedRng, cell_value As
String
selectedRng = InputBox("Enter your range (Using the
format Ai:Aj)")
Set rng = Range(selectedRng)
rng.Font.Italic = True
End Sub
Program to
change to bold fonts
Private Sub
CommandButton4_Click()
Dim rng, cell As Range, selectedRng, cell_value As
String
selectedRng = InputBox("Enter your range (Using the
format Ai:Aj)")
Set rng = Range(selectedRng)
rng.Font.Bold = True
End Sub
Private Sub CommandButton5_Click()
Dim rng, cell As Range, selectedRng, cell_value As
String
selectedRng = InputBox("Enter your range (Using the
format Ai:Aj)")
Set rng = Range(selectedRng)
rng.Font.Underline = True
End Sub
|