当单元格格式为其他格式时,未定义错误“xlValues" [英] Getting an error `xlValues` is not defined when Cells format to the others

查看:13
本文介绍了当单元格格式为其他格式时,未定义错误“xlValues"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 VBScript 将此处说A1"的单元格的格式复制到第一行的所有单元格,但出现错误 xlValues 未定义.

I am trying to copy the format of an Cell say here "A1" to the all cells of the first row using VBScript,but getting an error xlValues is not defined.

代码

  ob3.Range("A1").Copy
  ob3.Range("A1").EntireRow.PasteSpecial(xlValues) 'error here for that constants

你能帮我吗?

谢谢,

推荐答案

由于 VBScript 不知道 Excel 的常量,您必须自己定义它们:

As VBScript does not know about Excel's constant, you'll have to define them yourself:

Const xlValues = 123 ' <-- replace 123 with the correct value for your version of Excel

这篇关于当单元格格式为其他格式时,未定义错误“xlValues"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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