No video

Create Superscript and Subscript Macros

How to create Superscript and Subscript Macros to format Excel worksheet data.
Here's the complete VBA code:
Option Explicit
Dim intBegin As Integer
Dim intLen As Integer
Private Sub cmdClearData_Click()
TextBox1.Text = ""
End Sub
Private Sub cmdGetDataFromSheet_Click()
TextBox1.Text = ActiveCell.Text
End Sub
Private Sub cmdNormal_Click()
intLen = TextBox1.SelLength
If intLen Greater Than 0 Then
intBegin = TextBox1.SelStart + 1
ActiveCell.Characters(intBegin, intLen).Font.Subscript = False
ActiveCell.Characters(intBegin, intLen).Font.Superscript = False
End If
End Sub
Private Sub cmdSubScript_Click()
intLen = TextBox1.SelLength
If intLen Greater Than 0 Then
intBegin = TextBox1.SelStart + 1
ActiveCell.Characters(intBegin, intLen).Font.Subscript = True
End If
End Sub
Private Sub cmdSuperScript_Click()
intLen = TextBox1.SelLength
If intLen Greater Than 0 Then
intBegin = TextBox1.SelStart + 1
ActiveCell.Characters(intBegin, intLen).Font.Superscript = True
'ActiveCell.Characters(intBegin, intLen).Font.Superscript = True
End If
End Sub
Private Sub cmdUnload_Click()
Unload UserForm1
End Sub
NOTE: Please replace 'Greater Than' with angular bracket.
Get more details here: www.exceltrain...

Пікірлер: 5

  • @mayerjesus9646
    @mayerjesus9646 Жыл бұрын

    Excellent 🌟🌟🌟🌟🌟, lo necesitaba. Muchas gracias por compartir

  • @minhmadina9886
    @minhmadina98862 жыл бұрын

    You always best 🙂🙂🙂

  • @Exceltrainingvideos

    @Exceltrainingvideos

    2 жыл бұрын

    Thanks!

  • @Amin_BADAR
    @Amin_BADAR2 жыл бұрын

    Hi Mr Dinesh Kumar, hope you can help me solving my problem. I want to record max value on a live feed data. How can i do that?

  • @Kumaranmoljha
    @Kumaranmoljha2 жыл бұрын

    Please help me to do this I wand to highlights the list of date from multiple years date which is not fall in financial year mensed in cell b3 2019-20 List of date 1/01/21 ...... to 4/08/22..... Please help me to do this sir