使用VBA将INDIRECT公式输入到Worksheet单元格中 [英] using VBA to input a INDIRECT formula into Worksheet cell

查看:110
本文介绍了使用VBA将INDIRECT公式输入到Worksheet单元格中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是名为Summary Sheet的工作表中的公式,公式为G17的单元格,公式所引用的工作表称为PC01,该工作表中具有该值的单元格为J203。单元格A17包含PC01。 有许多单张
称为PC02,PC03以上可达100. 


G17 =间接("'"& A17&"'! J $ 203")


我试过了, 


范围(" G17")。公式=" = INDIRECT(" ""&"'"""& A17&"""'!J $ 203&""")"  但在我输入后,在第一个&符号后的第一个括号
之后输入一个额外的空格。


解决方案

你有太多的引号。


范围(" G17")。公式=" = INDIRECT(""'""& ; A17&安培;""'Ĵ


203"!")"


This is the formula in the sheet called Summary Sheet, the cell where the formula is G17, the sheet that the formula refers to is called PC01 and the cell in that sheet that has the value is J203. The cell A17 contains PC01.  There are a number of sheets called PC02,PC03 onwards up to maybe 100. 

G17=INDIRECT("'"&A17&"'!J$203")

I have tried, 

Range("G17").Formula = "=INDIRECT("""" & "'"""&A17&"""'!J$203 & """)"   but after I press enter an extra space is entered after the first parentheses after the first ampersand.

解决方案

You have too many quotes.

Range("G17").Formula = "=INDIRECT(""'""&A17&""'!J


203"")"


这篇关于使用VBA将INDIRECT公式输入到Worksheet单元格中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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