Excel VBA Formatting of Text -
i have code printing text given set of cells shown below:
'sample sheets("sheet1").range("a11") = "b. test samples" sheets("sheet1").range("b12") = "ss" sheets("sheet1").range("c12") = "part no." sheets("sheet1").range("c12:h12").merge sheets("sheet1").range("c12:h12").horizontalalignment = xlcenter sheets("sheet1").range("i12") = "valve code" sheets("sheet1").range("i12:m12").merge sheets("sheet1").range("i12:m12").horizontalalignment = xlcenter sheets("sheet1").range("n12") = "type" sheets("sheet1").range("n12:p12").merge sheets("sheet1").range("n12:p12").horizontalalignment = xlcenter sheets("sheet1").range("q12") = "ta/sealed" sheets("sheet1").range("q12:t12").merge sheets("sheet1").range("q12:t12").horizontalalignment = xlcenter sheets("sheet1").range("u12") = "qt" sheets("sheet1").range("v12") = "spring" sheets("sheet1").range("v12:x12").merge sheets("sheet1").range("v12:x12").horizontalalignment = xlcenter sheets("sheet1").range("y12") = "description"
it perfectly, want bold top cells. write following code achieve this:
'formatting range("b12").font.bold = true range("c12").font.bold = true range("i12").font.bold = true range("n12").font.bold = true range("q12").font.bold = true range("u12").font.bold = true range("v12").font.bold = true range("y12").font.bold = true
i not see wrong code, syntax seems fine formatting not changed. ie. cells want bolded remain unbolded.
could provide insight on why happening , how can possibly fixed?
make sure have sheets("sheet1")
before range().font.bold = true
Comments
Post a Comment