[mso] Re: VBA Naming Convention User Preference
- From: Kiran Naik <mrlsk@xxxxxxxxx>
- To: mso@xxxxxxxxxxxxx
- Date: Tue, 11 Nov 2008 11:39:01 +0200
Hi Lisa
I notice that to name your variables you use eg rlCell as Range which i make
out to be "r" for range what's the "l" for and there others you normally
adopt as some sort of naming convention and more importantly why!. Maybe
Linda could run an enquiry to see what sort of conventions users are using.
I use as below, hope the table comes out properly.
Rgds
KZ
VBA Naming Convention
Object
Convention
preferred
example
Integer
% or i or c or int
%
integer% or intIntegerName
long
&or l or c or lng
&
long& or lngLongName
single
! or s or sng
!
single! or sngSingleName
double
# or d or dbl
#
double# or dblDoubleName
currency
@ or cur
@
currency@ or curCurrencyName
string
$ or s or str
$
string$ or strStringName
variant
v or var
var
varVariant
date
dt
dt
dtDate
boolean
b or f
bln
blnBoolen
byte
b or bt
byt
bytByte
user defined type
u or ut
udt
udtUserDefinedType
range
rng
rng
rngRange
workbook
wb or wbk
wbk
wbkWorkbook
worksheet
ws or wks
wks
wksWorksheet
chart
ch or chrt
chrt
chrtChart
pivot table
pt or pvt
pvt
pvtPivotTable
font
fnt
fnt
fntFont
global variable
g or glb
glb
glbGlobalName
constant variable
CONSTANT
All Caps
CONSTANTNAME
On 03/11/2008 20:23:59, Green (1z@xxxxxxxxxxxxxx[1]) wrote:
>Hi Herbert,
>
>I felt a bit guilty so I put the following together.
>It should get you started.
>
>It will process the selected cells in a column and separate them out into
>the next column.
>
>HTH
>Lisa
>
>
>Sub subSeperate()
>
>Dim rlCell As Range
>Dim ilN As Integer
>Dim ilM As Integer
>Dim slIn As String
>Dim slOut As String
>Dim slArray() As String
>Dim rlLastCell As Range
>Dim ilThisColumn As Integer
>Dim ilNextColumn As Integer
>Dim ilCurrentRow As Integer
>Dim slWhat As
--- Links ---
1 mailto:1z@xxxxxxxxxxxxxx
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the dropdown
menu at the top. This will allow you to unsubscribe your email address or
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join
and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
Other related posts: