Excel VBA - Hide sheets based on drop down values in excel cell

  Рет қаралды 13,987

Antriksh Sharma

Antriksh Sharma

Күн бұрын

Пікірлер
@andrewclarke9286
@andrewclarke9286 Жыл бұрын
Hi, the code you posted for keeping certain tabs showing isn't working in the names array, the first code you posted in the video i got to work fine, can you help please?
@daniellemeganmarino1178
@daniellemeganmarino1178 3 жыл бұрын
hi. I have many tabs in my worksheet. If i only want to choose the tabs i want to include in the dropdown list, How will I unhide the tabs that I are not included in the dropdown list?
@vathsovanna339
@vathsovanna339 4 ай бұрын
If we want to view two sheets at the same time, what is the code?
@AntrikshSharma
@AntrikshSharma 4 ай бұрын
You can just go to View -> New Window -> View side by side
@CollDott
@CollDott 3 жыл бұрын
Awesome!
@HiteshPatel-hq4lt
@HiteshPatel-hq4lt 3 жыл бұрын
Hi Used your Code in my office template. However, minor change is required which I am unable to achieve though. Can you modify your code a bit. By default on opening of this file, only sheet "Data" will be visible and rest all other sheets will be hidden, and "Select a sheet" will appear in Range A2. Now depending upon selection in range A2, i.e. North:South:East:West, only respective Sheet will be unhidden first and made active (Assume North is selected in A2 which should make Sheet "North" be unhidden first and appear along with sheet "Data" and Sheet "North" will be the active Sheet for user to carry out Data entry). Once Data entry is done in Sheet "North" and when user selects sheet "Data" or Closes the Workbook, Sheet "North" will again get hidden and "Select a Sheet" will appear in range A2 in Sheet "Data" for user to selected another sheet and Cycle of operation continues. So, in other words, after selection in A2 only two Sheets will appear in any case. one "Data" and other selected from range A2. The Sheet "Data" is locked except for Range A2. All Data Entry in any sheet selected through Range A2 shall be automatically Saved. Thanks in advance.
@AntrikshSharma
@AntrikshSharma 3 жыл бұрын
Hello Hitesh, You can try this, in the WsNames array you can specify the sheets that you want to keep visible every time. I have uploaded the file here: drive.google.com/file/d/1t7SXs208OlcGBL74ory6cFniM67HSQD-/view?usp=sharing In the Sheet Data you have to enter this: ===================================================================== Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim Ws As Worksheet Dim WsNames() As Variant WsNames = Array(shData.Name, shAntriksh.Name) 'Specify the sheets that you always want to keep visible If Not Intersect(Target, Me.Range("A2")) Is Nothing Then For Each Ws In ThisWorkbook.Worksheets If UBound(Filter(WsNames, Ws.Name, True, vbTextCompare)) 0 Then If Ws.Name = Target.Value Then Ws.Visible = xlSheetVisible Else Ws.Visible = xlSheetHidden End If End If Next Ws End If End Sub ==================================================================== And in the ThisWorkbook Class Module you need to enter: Option Explicit Private Sub Workbook_Open() Dim Ws As Worksheet Dim WsNames() As Variant WsNames = Array(shData.Name, shAntriksh.Name) 'Specify the sheets that you always want to keep visible For Each Ws In ThisWorkbook.Worksheets If UBound(Filter(WsNames, Ws.Name, True, vbTextCompare)) = 0 Then Ws.Visible = xlSheetVisible 'Can change Visible to xlSheetHidden if you want to keep it available in the Right click menu in Excel Else Ws.Visible = xlSheetHidden End If Next Ws End Sub
@kingjosepaul
@kingjosepaul 2 жыл бұрын
Hello Antriksh, I created all worksheets , then I inserted a new worksheet for filter and entered hide worksheet VB codes and changed the sheet name as per VB , however its not working ???
@kingjosepaul
@kingjosepaul 2 жыл бұрын
All good mate, works perfect
@mahboubehamouzgar1496
@mahboubehamouzgar1496 3 жыл бұрын
Hi...so thanks for this amazing video🌸🌸🌸 I have lots of sheets and i need to know how can i have several of these sheets with just one option of droplist?
@rashmid8294
@rashmid8294 4 жыл бұрын
Hi, I am looking for a way to hide / unhide tabs in a protected workbook. is there a way? my excel has multiple private sub codes for multiple sheets.
@AntrikshSharma
@AntrikshSharma 4 жыл бұрын
Rashmi D You will first have to unprotect the workbook then hide/unhide the sheets and then protect the workbook once again. You could add the unprotect code in the workbook open event and protect code in the workbook before close event, both of these are available in ThisWorkbook module
@rashmid8294
@rashmid8294 4 жыл бұрын
@@AntrikshSharma that’s how typically it is done. I am looking for a way around. I am using VB codes currently. Any thoughts on that
@AntrikshSharma
@AntrikshSharma 4 жыл бұрын
@@rashmid8294 Okay, I am not sure what you meant by way around. Are you automating it through VB.net?
@rashmid8294
@rashmid8294 4 жыл бұрын
@@AntrikshSharma yes, the detailed query is posted on this link. Could you please have a look and help me understand how to fix this one www.excelforum.com/excel-programming-vba-macros/1329278-error-in-running-codes-in-protected-workbook.html#post5405614
@angelbhaves1
@angelbhaves1 4 жыл бұрын
Hi, I am trying to hide different worksheets based on multiple cell value. Can you help?
@benraphael3310
@benraphael3310 3 жыл бұрын
I know it is kinda randomly asking but do anyone know a good place to watch newly released tv shows online?
@bowendarius5084
@bowendarius5084 3 жыл бұрын
@Ben Raphael i watch on FlixZone. Just google for it =)
@jamesontravis2650
@jamesontravis2650 3 жыл бұрын
@Ben Raphael I watch on Flixzone. You can find it by googling :)
@jag398
@jag398 2 жыл бұрын
Thanks
@satishbhatt173
@satishbhatt173 2 жыл бұрын
Getting For error
@khairulhasan3527
@khairulhasan3527 3 жыл бұрын
need sample file
How To Hyperlink to a Hidden Worksheet - Excel VBA
14:42
Computergaga
Рет қаралды 63 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
Excel VBA IF THEN Statement (with ELSEIF & Looping in cells)
12:10
Leila Gharani
Рет қаралды 324 М.
Hide or Un-hide sheets based on selection using VBA in Excel
8:36
Vijay Perepa
Рет қаралды 2,3 М.
VBA to Hide and Unhide Columns on Conditional Basis - Excel VBA Example
11:09
Hide Multiple Sheets in Excel VBA - ExcelVbaIsFun Quick Tips
6:16
ExcelVbaIsFun
Рет қаралды 44 М.
Show Specific Sheets in Excel With Drop Down List
5:16
Contextures Inc.
Рет қаралды 69 М.
Hide/Show Sheets in Excel VBA Macro | Activate Sheets
6:03
Caleb Pecue
Рет қаралды 10 М.
Python in Excel vs. VBA - What You Should Learn in 2024!
10:05
David Langer
Рет қаралды 72 М.
VBA Macro Code to Hide Rows Based on Cell Values
4:34
Learn Excel VBA
Рет қаралды 39 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН