Y

YouLibs

Remove Touch Overlay

Create Superscript and Subscript Macros

Duration: 09:52Views: 1.7KLikes: 47Date Created: Dec, 2021

Channel: Dinesh Kumar Takyar

Category: Education

Tags: excel vba advanced tutorialfree excel vba examplesdownload vba exampleswhat is vba in exceladvanced excel vbacreate superscript and subscript macrosexcel to vbaexcel vba for beginnersformat data in excelexcel vba youtubelearn advanced excel vbagetting started with vbaexcel vba beginner tutorialexcel vba helpexcel vba for noobsexcel vba tutorials for beginnersexcel vba tutorialexcel vba for advanced learnersexcel vba easy

Description: 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: exceltrainingvideos.com/create-superscript-and-subscript-macros

Swipe Gestures On Overlay