简体   繁体   English

Range.Horizo​​ntalAlignment = 1在excel中的含义是什么

[英]What does Range.HorizontalAlignment = 1 mean in excel

I try to get sheet format in VBA, I found there is default value for HorizontalAlignment is equal to 1, but there is no this value in MSND, here are possible values, does anyone help me? 我尝试在VBA中获取表单格式,我发现Horizo​​ntalAlignment的默认值等于1,但在MSND中没有这个值,这里有可能的值,有没有人帮我?

xlCenter = -4108
xlDistributed = -4117
xlJustify = -4130
xlLeft = -4131
xlRight = -4152
Const xlHAlignGeneral = 1

You're looking at the wrong enum. 你看错了枚举。 Look into XlHAlign : 看看XlHAlign

  • xlHAlignCenter: -4108 xlHAlignCenter:-4108
  • xlHAlignCenterAcrossSelection: 7 xlHAlignCenterAcrossSelection:7
  • xlHAlignDistributed: -4117 xlHAlignDistributed:-4117
  • xlHAlighFill: 5 xlHAlighFill:5
  • xlHAlighGeneral: 1 xlHAlighGeneral:1
  • xlHAlignJustify: -4130 xlHAlignJustify:-4130
  • xlHAlignLeft: -4131 xlHAlignLeft:-4131
  • xlHAlignRight: -4152 xlHAlignRight:-4152

There's also a XlVAlign enum, for vertical alignment. 还有一个XlVAlign枚举,用于垂直对齐。 You can find it (and everything else) in the Object Browser (F2): 您可以在对象浏览器 (F2)中找到它(以及其他所有内容):

在此输入图像描述

Seems the xlCenter you're using is defined in the Excel.Constants enum. 看来xlCenter您所使用的定义Excel.Constants枚举。 XlHAlign and XlVAlign enum values are likely just aliases for them. XlHAlignXlVAlign枚举值可能只是它们的别名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM