公式アカウントからの投稿が始まります

いつもお世話になります。

VBAでB9からE24に罫線を引いてたのですが、急にエラーが出るようになりました。
今までは出ませんでしたが、2003で使用しだしてから、
出たり、出なかったりします。

作成 winxp Office2002で、
使用は別端末 winxp Office2003です。
コードはマクロの記録より引用。
シート保護はしていません。

[メッセージ]
 実行時エラー'1004':
 BorderクラスのLinestyleプロパティを設定できません。
[コード]
Range("B9:E24").Select
With Selection.Borders(xlEdgeLeft)
  .LineStyle = xlContinuous <--※※
  .Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
  .LineStyle = xlContinuous
  .Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
  .LineStyle = xlContinuous
  .Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
  .LineStyle = xlContinuous
  .Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
  .LineStyle = xlContinuous
  .Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
  .LineStyle = xlContinuous
  .Weight = xlThin
End With
With Selection.Borders(xlEdgeLeft)
  .LineStyle = xlContinuous
  .Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
  .LineStyle = xlContinuous
  .Weight = xlMedium
End With
With Selection.Borders(xlEdgeBottom)
  .LineStyle = xlContinuous
  .Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
  .LineStyle = xlContinuous
 .Weight = xlMedium
End With
With Selection.Borders(xlInsideVertical)
  .LineStyle = xlContinuous
  .Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
  .LineStyle = xlContinuous
  .Weight = xlThin
End With

F8で一行づつ実行しても.LineStyle、.weightの全行で引っかかります。

解決策ご存知の方、宜しくお願い致します。

A 回答 (1件)

シートに保護をかけていませんか?



かかっていなければ、パスしてください
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!