2、nt.Subscript=True(下标) [a1].Characters(Start:=2,Length:=1).Font.Superscript=True(上标)如何确定那些格变什么的,你描述不太情楚没看懂,上面是变第2个字符下上标的方法实现在一个单元格中输入公差(上下标)如下图效果:代码如下:Sub输入公差() i = InputBox("请输入基数:")If i = "" Then MsgBox "无效!即将推出!"End End If j = InputBox("请输入下标:")If i = "" Then MsgBox "无效!即将推出!"En
3、dEnd If k = InputBox("请输入上标:")If i = "" Then MsgBox "无效!即将推出!" End End If ii = Len(i) jj = Len(j) l = ActiveCell ll = Len(l)ActiveCell.Select Selection.NumberFormatLocal = "@"ActiveCell.FormulaR1C1 = l & i & j With ActiveCell.Characters(Start:=ll + 1, Length:=ii).Font '基数字体设置Name
4、= "宋体".FontStyle = "常规" .Size = 11 End With With ActiveCell.Characters(Start:=ll + ii + 1, Length:=jj).Font '下标字体设置Name = "宋体".FontStyle = "常规".Size = 5End WithSelection.Phonetics.Visible = True With Selection.Phonetics.Font ‘上标字体设置.Name = "宋体".FontStyle = "常规".Size = 5.Strikethro
5、ugh = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With ActiveCell.Characters(ll + ii + 1, 1).PhoneticCharacters = k With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .AddIndent = False .Inde
6、ntLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With End Sub 能不能限制按钮点击次数?PrivateSubCommandButton1_Click()Range("A1").Value=Range("a1").Value+1IfRange("a1").Value=3ThenCommandButton1.Enabled=FalseEndIfEndSub在thisworkbook模块中:PrivateSubWorkbook_Befo