sefraoui

New Member
Joined
Dec 31, 2018
Messages
1
[COLOR=rgba(0, 0, 0, 0.75)]hi,i want a solution of my problem in VBA:I have a main page (a directory for all the sheets) which is hyperlinked to numerous sheets and all have hyperlinks to take me back to the main page and the sheet hide automaticaly . My problem is when i protect workbook (structure protection) the hyperlink dont work , an error occur : error run time 1004unable to set the visible property of the worksheet classthis is the code that i used:Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)LinkTo = Target.SubAddressWhereBang = InStr(1, LinkTo, "!")If WhereBang > 0 ThenMySheet = Left(LinkTo, WhereBang - 1)MySheet = Application.WorksheetFunction.Substitute(MySheet, "'", "")Worksheets(MySheet).Visible = TrueWorksheets(MySheet).SelectMyAddr = Mid(LinkTo, WhereBange + 1)Worksheets(MySheet).Range(MyAddr).SelectEnd IfEnd Sub[/COLOR]
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,215,398
Messages
6,124,690
Members
449,179
Latest member
kfhw720

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