Unhide Columns Based On Password

Jan 31, 2008

My problem is that I need column B:B to hide if it's not hidden, if it is hidden to be unhidden via the textbox password box but I don't want the textbox to appear when hitting the button to hide which it does and that then causes me to have to hit the cancel button to leave the column hidden. Here is the code I came up with:

Sub PasswordBoxCode()
ActiveSheet. Unprotect ("13792468")
Columns("B:B").Select
If Selection.EntireColumn.Hidden = False Then Selection.EntireColumn.Hidden = True
If Selection.EntireColumn.Hidden = True Then PasswordBox.Show
ActiveSheet.Protect ("13792468")
Range("A1").Select
End Sub

And then for the userform code I have this:

Private Sub CommandButton1_Click()
If TextBox1.Value = "1379" Then
ActiveSheet.Unprotect ("13792468")
Columns("B:B").Select
Selection.EntireColumn.Hidden = False........................

View 3 Replies


ADVERTISEMENT

Hide & Unhide Columns With Password

Nov 9, 2006

I have a range of columns ( J:AH) which i have to hide from the user interface.In order to unhide, the editor must enter a password. He/ She can only enter the password thrice. After 3 times, if it is still wrong, the whole workbook must be closed. Is this possible? If not, I'll settle for something less complicated.

View 9 Replies View Related

Password Protect Columns - Hide And Protect Ability To Unhide

Jan 17, 2013

Some sensitive data is held on worksheets that are used by people that do not have access to see the data.

It would be most convenient to keep the data in these worksheets but hide it from view of the users.

Is there a way to password protect a users ability to unhide a column?

View 2 Replies View Related

Hide & Unhide Columns Based On A Cell Value

Feb 21, 2010

worksheet I am working on at the moment, basically if row 5 has a 0 displayed I want that column to hide, but if row 5 has text of any value displayed I want it to unhide, the range is E5 to BA5 across.

I have draft VBA code as follows:

View 9 Replies View Related

Hide And Unhide Columns Based On Cell Value

Mar 4, 2013

I need to write a macro that will hide and unhide columns based on a cells value. I know how to write it to hide and unhide rows, but i can figure it out for columns.

For the rows I am using the following:

Sub HideRowsSavings()
Dim LR As Long, i As Long
Application.ScreenUpdating = False
With Sheets("Savings #4")
LR = .Range("A" & Rows.Count).End(xlUp).Row

[Code] ......

View 1 Replies View Related

Hide/Unhide Columns Based On Cell Value

Sep 4, 2007

I've attached one speadsheet :- "VBA.xls". The following conditions are to be done:-
1. When D2=1, Column "F","G" are visible & Column "I","J","L","M" are hidden.
2. When D2=2, Column "I","J" are visible & Column "F","G","L","M" are hidden.
3. When D2=3, Column "L","M" are visible & column "F","G","I","J" are hidden.

View 9 Replies View Related

Macro To Unhide Columns Based On A Users Input

Apr 2, 2014

I'd like for my spreadsheet to open with only Column A visible; I'd like all other collumns to stay hidden.

I want to create a marco to unhide column(s) based on the value of an individual cell.

For example:

if I enter the number 5 into cell A1, I would like Columns B:F to unhide.
if I enter the number 2 into cell A1, I would like Columns B:C to unhide. Is this possible?

View 10 Replies View Related

Hide / Unhide Columns Macro Based On Cell Value?

Dec 7, 2011

I want to hide and unhide columns based on a cell's value.

If D6 of the ‘Summary’ Worksheet Is <> to ‘Test1’ and <> ‘Test2’
THEN Hide columns D:K of the ‘Charts – Source Data’ Worksheet
OTHERWISE Unhide columns D:K

View 4 Replies View Related

Hide And Unhide Columns Based On Cell Value From Lookup

Dec 4, 2013

I am trying to hide/unhide columns based on what is return to cell C2 from this lookup (=VLOOKUP(B2,GM!E2:M129,9,FALSE)). It can only return 3,6 or 9

If it returns 3 I want to hide columns I:P
If it returns 12 I want to hide columns E:L
If it returns 6 I want to hide E:H and M:P

I have been trying to work with this code which I found on this forum but I haven't been able to get it working fully. It only works when C2 is entered rather than calculated and I can't get it working for the M:P part of the third option.

Code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Changed As Range
Set Changed = Range("C2")
If Not Intersect(Target, Changed) Is Nothing Then
Range("A:Z").EntireColumn.Hidden = False

[Code]...

View 1 Replies View Related

Hide/unhide Number Of Columns Based On Cell Value

Jul 17, 2007

If I have a value in A1 and run a macro [button], I want to have it hide a number of rows.

Each number is one column.

eg if A1 = 2 then B:C are visible, D:IV Hidden
if A1 = 3 then B:D are visible, E:IV Hidden
if A1 = 4 then B:E are visible, F:IV Hidden

up to 200 columns.

I tried it as a select case, but it is limited to just 22 cases which obviously not enough.

View 9 Replies View Related

Unhide/hide Multiple Columns Based On Date

Jul 30, 2007

I need to show hidden columns based on the date I entered. For example, if I entered "1/1/1990" on a1 as the starting date and "4/30/1990" on b1 as the ending date. I want Excel to show the columns that are covered by the date, thus it shows Jan, Feb, March and April. How do I do that? Here's an example attachment. In here Sheet 1 is the starting point, the highlighted cells is where I enter the date. the Result sheet shows what I want Excel to show me when I have a date entered.

View 8 Replies View Related

Hide / Unhide Rows And Columns Based On Several Date Ranges

Mar 19, 2014

I am building a sheet to display deadlines (rows) by project (columns). I would like to have it automatically hide the rows and columns based on the date of the deadline. If the deadline is today or 1 week from today the associated rows and columns should be visible, otherwise, I would like to hide them.

My table is A1:N9, with A1 being a blank, row names A2:A9, and column names B1:N1.

View 4 Replies View Related

Hide/unhide Columns Based On Dropdown List Answer

Sep 26, 2008

I am a newbie to Excel. I really appreciate if someone could help me here and this is very urgent as I have a project going on.

I have a cell say B3, which is a dropdown list I created using Data Validation. It only lists down Yes or No.

What I need is when you click on Yes in B3, i need columns C to I to unhide. If answer is No, column C to I should be hidden. By default, the columns will be hidden.

Can you please help? I tried many times but not successful. Appreciate if someone will be able to walk me through details. If you want to see the sample spreadsheet, I can sent it to you by email. I tried Data> Outline group but they are not happy with this.

View 9 Replies View Related

Automatically Hide/Unhide Columns Based On Cell Text

Jan 10, 2009

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 13 Then Exit Sub
If InStr(Target.Value, "Other (specify in next column)") Then
Columns("N").Hidden = False
ElseIf WorksheetFunction. CountIf(Columns("M"), "Other (specify in next column)") = 0 Then
Columns("N").Hidden = True
End If
End Sub

but I have a lot of columns that I need to perform as above and I have put the code together as below

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next

If Target.Column = 13 And InStr(Target.Value, "Other (specify in next column)") Then
Columns("N").Hidden = False
ElseIf WorksheetFunction.CountIf(Columns("M"), "Other (specify in next column)") = 0 Then.................

Using the above code, when I selected more than one cell anywhere in my workbook and pressed delete I was bugging out with a runtime error 13 message. You can see from the above code that I inserted "On Error Resume Next" - this got rid of the runtime error 13 message, but now when I select more than one cell and press delete, hidden columns are incorrectly revealed in my worksheet. how I can extend the working code at the top of this posting so that it works for a number of different columns in my Worksheet i.e. without the runtime error 13 occurring and without columns being incorrectly revealed.

View 8 Replies View Related

Password To Unhide Sheets

Sep 25, 2009

I wanted to know if there is a way to lock some sheets in a workbook to prevent anyone to view them. I have a workbook with sheets that have a database, it is shown the frontsheet, and when a person selects an option it will appear a sheet with the data selected initialy. I wanted the other sheet to be hidden and locked so the one goes to the unhide menu and selects a sheet to unhide a msgbox appears to ask a pass code.

View 3 Replies View Related

Unhide A Column With A Password

Feb 20, 2010

I have column B hidden as it holds information that only certain people should be able to see.

I have a button in column A which when pressed, I would like the following...

1- a prompt box to ask for a password

2-once the password is entered, Column B unhides.

3-once an entry in Column B has been made, it automatically hides again.

View 9 Replies View Related

Require Password To Unhide Certain Sheets?

Mar 14, 2014

I have a file with the following sheets: P1, P2, P3, Inventory. This file is sent to different people (users Ab, Ad, An) and P1-P3 sheets are set as "VeryHidden" because we want to avoid for example that user "Ab" can see or unhide certain sheets.

I'm wondering if it's possible to request a password when opening the document then unhide certain sheets according with that password, there will be 3-6 users.

View 2 Replies View Related

Different Password To Unhide The Hidden Sheets.

Nov 22, 2008

I have 5 sheets, 3 of them are hidden, how can i put a 3 different password to unhide the hidden sheets.

View 6 Replies View Related

Hide Sheets, Then Need Password To Unhide

Oct 6, 2008

See I have hidden my sheets and I need them to stay hidden.

But when I need to unhide them, a password should be needed to unhide them.

Maybe add a button on one of the open sheets that when pressed will unhide the sheets but will promt for password.

View 9 Replies View Related

Hide / Unhide Columns In Multiple Worksheets Based On Item Chosen In Dropdown List?

Feb 26, 2014

I am hoping to create a drop down list of months in one sheet, and when I select a certain month, columns in about 10 other worksheets in the same workbook will either hide or unhide columns...

The spreadsheet is laid out with columns (C-N) for each month in the year, for actuals, then columns for budget and budget variance (O-P), then YTD Actual, YTD Budget and YTD Variance. When I select September, for example, I want October-December to hide, and leave Jan-Sep unhidden, while keeping the budget, YTD and variance columns.

Is there a VBA code that can achieve this?

View 14 Replies View Related

VBA Code - Unhide Multiple Sheets With Password?

May 18, 2011

Am trying to find the VBA code to "ask a user for the password to unhide multiple sheets/tabs"

I have got the script for unhiding all sheets which is:

Sub Sheets_Unhide()
Dim sh As Worksheet
For Each sh In Worksheets
sh.Visible = True
Next
End Sub

What i would like though is for it to prompt with a password first before the code is executed for unlocking 50 odd sheets.. I know its not 100% fool proof, but would do for what i need!

View 6 Replies View Related

PASSWORD/Code To Unhide Rows And Worksheet Tab

Jun 15, 2007

I have a protected sheet so specific people can only see certain things. I would like code to Unhide a tab called "Estimating" and unhide Rows 2 through 9 and rows 24, 26 and 27.

View 9 Replies View Related

Hide Selected Sheets And Not Unhide Without Entering Password

Mar 18, 2014

I want to hide selected sheets and when i want to unhide them, ask for password to unhide the sheets.

View 10 Replies View Related

How To Unhide Columns

Aug 13, 2012

I want to unhide columns K:DY if cell B2 = ALL, if cell B2 is something other than ALL, hide columns K:DY.

Is there any VBA code for that.

View 6 Replies View Related

Cannot Unhide Columns In A Worksheet

Feb 27, 2009

The workbook contains 5 worksheets, 4 of which will unhidden just fine; the remaining worksheet ("AnnualBudget" refuses to unhide columns AD to IV. Of course, this is the sheet that contains data in those hidden cells and I cannot get to the data. The sheet is unprotected and all freeze panes removed.

I have copied this sheet to a new sheet in the same workbook:

If I copy only formulas and number formats, the new sheet has all columns unhidden. If I copy formats, I have the same issue with the new worksheet. It’s like these columns are forever locked from view.

FYI I am using Excel 2007 with a 2003 compatability worksheet

A copy of the workbook is attached. Any idea what’s happening?

View 6 Replies View Related

Hide/Unhide The Columns

Jun 16, 2009

I've come across a spreadsheet where certain rows and columns (typically top rows or left columns) are hidden; however, there's no way to unhide them (the unhide function is grayed out) and it doesn't seem to be protected or no visible macros/vba on the file.

View 3 Replies View Related

Hide/Unhide Columns

Dec 19, 2008

I have a spreadsheet that has 28 columns for time entries. Typically only the first 12 columns are used, so I would like to hide the remaining 16 columns (which makes the spreadsheet much more user-friendly). It would probably be nearly impossible to teach all of them how to Unhide the remaining columns (and re-Hide), plus I would like to use the full-screen function when employees enter thier times. I would like to use a form control in the column heading so that when the employees 'check' it, it will Unhide and then re-Hide the columns. Any way to do this? Seems like a VB thing to me (out of my league, but would be happy to add one in!).

View 2 Replies View Related

VBA To Unhide And Hide Columns?

Oct 23, 2002

I want to create two buttons.. one name HIDE and the other UNHIDE.

What I need hide button to do when i click it is hide the 4 columns to the right (not always going to be columns b:e)

For the unhide button unhide the 4 columns to the right (not always going to be columns b:e)

View 9 Replies View Related

Hide / Unhide Columns By The Use Of + And -

Mar 5, 2013

I once saw an excel sheet where I could hide or unhide a section by some + and - signes above the column-letters.... I have searched for this but I only get the ordinary hide/unhide solutions.

View 4 Replies View Related

Macro To Unhide Columns - Call A Macro Then Revert Columns To Previous State

Jul 17, 2014

I have on sheet1 a number (72 at the moment) of Form CheckBoxes.

In simple terms: I would like a macro to look at each CheckBox and remember its state (Checked or Unchecked)

Then, go through and Check All checkboxes

Call MyMacro

Once MyMacro is complete (Filtering & Printing)

Revert the checkboxes to their original state.

The purpose of the checkboxes:

When Checked column on sheet2 is UnHidden
When UnChecked column on sheet2 is Hidden

Or, UnHide All columns on sheet2, run MyMacro, then "re-hide" the columns that were previously hidden.

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved