您好,欢迎来到中国最大的生活服务网站![登录][注册]
版主:Mniwtian   副版主:
点击查看所有副版主

Because VBA variable

 SummedValue = _

      Worksheets("Sheet1").Range("A1").Value + _

      Worksheets("Sheet2").Range("A1").Value

End Sub

 

When you record macros, Excel often uses underscores to break long statements into multiple lines.

 

After you enter an instruction, VBA performs the following actions to improve readability:

 

It inserts spaces between operators. If you enter Ans=1+2 (without spaces), for example, VBA converts it to

 

Ans = 1 + 2

 

It adjusts the case of the letters for keywords, properties, and methods. If you enter the following text: Result=activesheet.range("a1").value=12

 

VBA converts it to

 

Result = ActiveSheet.Range("a1").Value = 12

 

Notice that text within quotation marks (in this case, "a1") is not changed.

 

names are not case-sensitive, the interpreter by default adjusts the names of all variables with the same letters so that their case matches the case of letters that you most recently typed. For example, if you first specify a variable as myvalue (all lowercase) and then enter the variable as MyValue (mixed case), VBA changes all other occurrences of the variable to MyValue. An exception occurs if you declare the variable with Dim or a similar statement; in this case, the variable name always appears as it was declared.
用户名: 请您登录后再发帖 
标 题: 标题请勿超过30个字
内 容:
 
  请阅读我们的[服务条款]
Copyright © 2009 Yahoo.com.cn 版权所有 不得转载 | 使用须知 | 著作权声明 | 京ICP证000022号 | 国家药监局(京)-经营性-2004-0039
全球阿里巴巴 - 阿里巴巴网络:中国站 国际站 日文站 | 淘宝站 | 支付宝 | 中国雅虎 | 口碑网 | 阿里软件 | 阿里妈妈