0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ExcelのシートでアクティブセルをA1にしておくのがマナーって話を聞いたので

Last updated at Posted at 2024-09-25

セルはA1をアクティブにするのがマナーらしい

以前Twitterで流れてきた話(ぼくは気にしない派)

対策

↓をThisWorkBookのBeforeSaveに入れておけば保存するときに全部A1なる。

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Dim objSh As Worksheet
    Dim objShORG As Worksheet
    
    Set objShORG = ActiveSheet '最初に開いていたシート
    
    For Each objSh In ThisWorkbook.Worksheets
        objSh.Select
        Application.Goto Reference:=Range("A1"), Scroll:=True
    Next
    
    objShORG.Select '最初に開いていたシートを表示する
End Sub
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?