I'm having some trouble defining constants correctly.
I know the format should be this:
Const CONSTANT_NAME [As ConstantType] = value
But I'm a little unclear of how to word it. So here is the Line I need to change into a Constant. Normally I would have a BAS file do this but I can't find one (Refer to other post).
.Font.ColorIndex = 50
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
That's the entire section that I'm dealing with. I don't think all of it needs to be constants, but maybe it does? I'm not sure. All I know is that the tutorial helping me with creating automation suggested that I turn my Code into Late-Bound to help with compatibility issues a User might have in regards to opening Excel. As a result, I have had to drop the Excel Reference that I was using therefore, having to define my own constants. As stated previous, here and in the other Thread, I wanted to make it easier by Inserting a BAS File into a Module as suggested and provided by the Tutorial I'm using but there were x64 bit compatibility issues with that so I couldn't. If anyone could help me turn the "xlCenter" part into a Constant it would be greatly appreciated. I am very new at this and still learning so I thank you for your patience.
Thank you for taking the time to read this
11 Months Ago
Related Article:Visual Basic has stopped working
is a solved Visual Basic 4 / 5 / 6 discussion thread by fx.eko that has 6 replies, was last updated 1 month ago and has been tagged with the keywords: visual, basic, 6, has, stopped, working.
''Private if it is used within your current form or public if called from other forms or sheets...
''It also seems that it will be of a type integer(number) ...
Private Const xlCenter As Long = 1 ''Your value here.
''If it is a strin...
Private Const xlCenter As String = "My Value Here"