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

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

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -