excel - Pass VBA Sub a Range -


i keep getitng error "type missmatch"

i want able format cells in spreed sheet passing range , value i'd displayed.

can point out i'm going wrong?

sub layout()  call create_box("a1:a2", 10)  end sub  sub create_box(r range, v string)       dim box object     set box = range(r)         box             .merge             .value = box_value             .horizontalalignment = xlcenter             .verticalalignment = xlcenter             .border.style = continous             .border.color = black             .border.weight = xlthick         end  end sub` 

the parameter passing in not range object; string represenfting range object's local address property.

sub layout()     activesheet  '<-set explicitly sheets("sheet1")         call create_box(.range("a1:a2"), 10)     end end sub  sub create_box(r range, v string)         r             .merge             .value = box_value             .horizontalalignment = xlcenter             .verticalalignment = xlcenter             .border.style = xlcontinuous             .border.color = 0             .border.weight = xlthick         end end sub 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -