错误在范围内插入公式的应用程序定义或对象定义的错误 [英] Error Application-defined or object-defined error for insert formula in range

查看:91
本文介绍了错误在范围内插入公式的应用程序定义或对象定义的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想放
一个公式
范围
of cells。


公式
是这样的:


 Public Sub InserisciFormulaSemplice()
工作表("Sheet1")。激活
范围(范围("E1"),范围("E1")。结束(xlDown))。公式=" = IF(ISNA(VLOOKUP(C2;') C:\ Users\fabrizio \Documents\BBG \ [bbg.xls] Archivio Pear'!$ A $ 1:$ E $ 65536; 5;));"&" NO"&" ;&"&" PEAR" ;&")"
End Sub

解决方案

首先,您必须在VBA中使用逗号作为列表分隔符,甚至如果你使用分号;在你的系统上。


第二,你必须在公式中的字符串周围使用双引号:


 


范围(范围("E1"),范围("E1")。结束(xlDown))。公式=" ; = IF(ISNA(VLOOKUP(C2,'C:\Users\fabrizio \Documents\BBG \ [bbg.xls] Archivio Pear'!


A

1

I want to put a formula in a range of cells.
The formula is this:

Public Sub InserisciFormulaSemplice()
Worksheets("Sheet1").Activate
Range(Range("E1"), Range("E1").End(xlDown)).Formula = "=IF(ISNA(VLOOKUP(C2;'C:\Users\fabrizio\Documents\BBG\[bbg.xls]Archivio Pear'!$A$1:$E$65536;5;));" & "NO" & ";" & "PEAR" & ")"
End Sub

解决方案

In the first place, you must use a comma as list separator in VBA, even if you use a semi-colon ; on your system.

In the second place, you must use double quotes around strings within the formula:

 

Range(Range("E1"), Range("E1").End(xlDown)).Formula = "=IF(ISNA(VLOOKUP(C2, 'C:\Users\fabrizio\Documents\BBG\[bbg.xls]Archivio Pear'!


A


1:


这篇关于错误在范围内插入公式的应用程序定义或对象定义的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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