怎样让单元格中的分数(注分数单元格式是常规),在公式中能直接参与计算?
首先,设置你要输入内容的单元格格式为文本格式。再右键当前工作表。查看代码。粘贴如下代码。再返回工作表中,输入内容。试试看 Private Sub Worksheet_Change(ByVal Target As Range)Application.EnableEvents = FalseOn Error GoTo label1Target.NumberFormatLocal = "@"Target = Evaluate(Target.Value)Application.EnableEvents = TrueExit Sublabel1: Target = ""Application.EnableEvents = TrueEnd Sub