Insert file name on every open workbook.

Genetu

New Member
Joined
Apr 20, 2022
Messages
23
Office Version
  1. 2016
Platform
  1. Windows
Hi guys, I want to make this. I am sharing my computer with three of my colleagues. If they open any excel file (new or saved), the value is B2 is the organization's name, and save. I tied this.

VBA Code:
Sub Auto_Open()
ThisWorkbook.ActiveSheet.[B2] = "Shield.Org"
activeworkbook.Savechanges:=true
End Sub
But on every active sheet the text "Shield.Org" does not exist on B2. I need your valuable help. Thanks in advance.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
The below will change every sheet on file open however it will only work on files that contain the below piece of code:
VBA Code:
Sub Auto_Open()
    Dim ws As Worksheet
    
    For Each ws In Sheets
        ws.[B2] = "Shield.Org"
    Next ws
    ThisWorkbook.Save
End Sub
 
Upvote 0
The below will change every sheet on file open however it will only work on files that contain the below piece of code:
VBA Code:
Sub Auto_Open()
    Dim ws As Worksheet
   
    For Each ws In Sheets
        ws.[B2] = "Shield.Org"
    Next ws
    ThisWorkbook.Save
End Sub
Yeah, It is not working for all opening books.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top