excel vba - Let Value-string, Get value long VBA -
i'm using class module store values position of buttons. use same function add 3 buttons in row, , need change .left
position button based on type;
ie 'create' button, @
.left
value column afor 'update' button, @
.left
value column bfor 'destroy' button, @
.left
value column c
i add case select in code, readability think sit better in class module.
currently trying following- relevant lines in class module:
private pleft long public property left() long left = pleft end property public property let left(strtype string) select case strtype case "create" pleft = prange.offset(0, 4).left case "update" pleft = prange.offset(0, 5).left case "open" pleft = prange.offset(0, 6).left end select end property
relevant lines in module:
dim button cbutton sub letvalueforleft() set button = new cbutton button.left = "create" end sub
heart breakingly error :
i assume because i'm leting string , geting long, there way around this?
i have been using useful guide below, says nothing type of situation:
the let
, get
of property need same type. if understand correctly you're trying do, can make left
read-only property , use method initialize it:
'class private pleft long public property left() long left = pleft end property public sub assignleft(strtype string) select case strtype case "create" pleft = prange.offset(0, 4).left case "update" pleft = prange.offset(0, 5).left case "open" pleft = prange.offset(0, 6).left end select end sub
you'd call this:
set button = new cbutton button.assignleft "create"
Comments
Post a Comment