VB6、Win2000です。
'表に罫線を引く
×××.Range("B1:D20").Borders.LineStyle = xlContinuous
'外枠を太線に
×××.Range("B1:D20").Borders(xlEdgeTop).LineStyle = xlGray75
×××.Range("B1:D20").Borders(xlEdgeLeft).LineStyle = xlGray75
×××.Range("B1:D20").Borders(xlEdgeRight).LineStyle = xlGray75
×××.Range("B1:D20").Borders(xlEdgeBottom).LineStyle = xlGray75
↑という感じに、VBのSpreadSheetのデータをエクセルにはき出して罫線を引いているのですが、はき出すデータの行の数はその都度変わります。
その行数によってRangeの範囲設定を変えたいのですが、何かいい方法はありますでしょうか?
Dim xlRange As Excel.Range
Dim intRow1 as Integer = …
Dim intRow2 as Integer = …
Dim intCol1 as Integer = …
Dim intCol2 as Integer = …
×××.Range(xlRange(intRow1, intCol1), xlRange(intRow2, intCol2)).Borders(〜
とか?
しまった、
xlRange = ×××.Cells
も必要かも。
ツイート | ![]() |