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

查看:82
本文介绍了当单元格格式化为其他单元格时,未定义错误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天全站免登陆