Excel VBA Font.Superscript代码不起作用 [英] Excel VBA Font.Superscript code does not work

查看:56
本文介绍了Excel VBA Font.Superscript代码不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此excel代码不起作用.为什么?确实,我无法使任何上标代码生效.我使用Excel 2007

This excel code does not work. Why? Indeed I can not make work any superscript code. I use Excel 2007

注意:intRow和intColumn是确定行和列的整数.

note: intRow and intColumn are integers which determine the row and column.

Cells(intRow, intColumn).Characters(Start:=Len(Cells(intRow, intColumn).Value), Length:=1).Font.Superscript = True

推荐答案

我发现了问题.这是单元格的 format .它必须是 text .

I found the problem. It is the format of the cell. It must be text.

上标行之前添加该行即可解决问题:

Adding that line before the superscript line solved the problem:

Cells(intRow, intColumn).NumberFormat = "@"

谢谢.

这篇关于Excel VBA Font.Superscript代码不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆