Hide Confidentiality row with vba code when excel is opened

Raffe123

New Member
Joined
May 12, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hello all,

Can I will vba code hide the confidentiality row when excel is opened?

/R
 

Attachments

  • Hide.jpg
    Hide.jpg
    100.4 KB · Views: 24

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
You can try and customize the below VBA Code as per requirement and see it it works in your case.

Sub sbHidingUnHideRows()

'To Hide Rows 22 to 25
Rows("5:8").EntireRow.Hidden = True

'To UnHide Rows 22 to 25
Rows("5:8").EntireRow.Hidden = False

End Sub
 
Upvote 0
@Raffe123
Keep in mind though that if someone disables macros on the workbook, no macro will hade a row !!
And the code posted by @ashakantasharma will need to be in a Workbook_open macro in the "ThisWorkbook" module
 
Upvote 0
What row is that ??... in the attachment you provided ??
It looks like the formula bar to me !!
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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