|
-
Dec 15th, 2005, 05:10 PM
#1
Thread Starter
Member
VB for Excel
When I generate a macro to change the name of the columns of an Excel sheet from A, B, C, etc to 1, 2, 3, etc,the code that appears is:
With Application
.ReferenceStyle=x1R1C1
.UserName="zzzz"
.StandardFont'"Arial"
.StandardFontSize="10"
.DefaultFilePath="C:\Documents and Settings\zzzz\MyDocuments"
.EnableSound=False
.RollZoom=False
End With
and it works O.K.
When I intend to use similar codes in a VB program I get error ( as if x1R1C1 is a variable not defined). I suspect that I need the values of the constants x1R1C1 as well as the values for x1L1C1 and x1A1.
Can anyone give me the values of these constants...or where can I get them?
Thanks!!
-
Dec 15th, 2005, 06:53 PM
#2
Re: VB for Excel
You can get the values from Excel, just go into the VBA editor and press F2. You can then enter the name of the constant in the second drop-down, and press the button next to it.
You will see a list of all items that match what you typed, just select the right one (if it isn't selected already), and the declaration will be shown at the bottom of the window, eg:
VB Code:
Const xlR1C1 = -4150 '(&HFFFFEFCA)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|