アプリ版:「スタンプのみでお礼する」機能のリリースについて

いつもお世話になっております
下記のコードは改ページを挿入するコードなのですが、
w.PageSetup.PrintArea = Range("B3", Cells(Rows.Count, "B").End(xlUp))
でエラーになります。
わかる方おしえてくれませんでしょうか

Dim w As Worksheet
Set w = ActiveSheet

w.PageSetup.PrintArea = Range("B3", Cells(Rows.Count, "B").End(xlUp))

w.ResetAllPageBreaks
w.HPageBreaks.Add Range("A13")

w.VPageBreaks.Add Range("G:G")

A 回答 (1件)

こんばんは


Range("B3", Cells(Rows.Count, "B").End(xlUp))はオブジェクトです
PageSetup.PrintAreaは範囲を示す文字列でなければなりません

w.PageSetup.PrintArea = Range("B3", Cells(Rows.Count, "B").End(xlUp)).Address
    • good
    • 0
この回答へのお礼

いつもありがとうございます。

お礼日時:2022/12/05 07:59

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