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


ADVERTISEMENT

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

Dropdown List - Item Can Only Be Chosen Once?

Mar 9, 2014

[URL]

I had this posted in Formulas and functions

View 1 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

Unhide/Hide Column When Choosing Dropdown List

Oct 5, 2009

Is there a way to have a column unhide one choosing a certain value from a dropdown list (validation)? I want the column to be hidden throughout the worksheet until a specific value is chosen in the list. Once it's chosen then I want it to unhide that column.

View 4 Replies View Related

Calculate Average Based On Item Chosen From List

Apr 21, 2009

My attached files contains stock returns for companies. Each sheet contains the returns over a 5 year period for a certain stock, with the ticker symbol of the stock used as the sheet name. I want to write a sub that presents the user with a user form. This user form should have an OK and Cancel buttons, and it should have a list box with a list of all stocks. The user should be allowed to choose only one stock in the list. The sub should then display a message box that reports the average monthly return for the selected stock.

View 4 Replies View Related

Go To Cell Based On List Item Chosen From Drop-Down

May 7, 2008

I have a set of data on excel and would like to make searching for it easier.

I have created a drop down list in cell B4 (say, "Banana", "Apples" and "Orange"). Is there a way that if i select "Banana" in cell B4, excel will automatically go to cell A20 ?

View 3 Replies View Related

How To Hide / Unhide Rows Based On Selection From Dropdown Box

Feb 1, 2013

I have a worksheet that allows you to choose 1-20... depending on the selection it should unhide specific rows but I keep getting errors...

Code that will allow you to unhide other worksheets in the same book????

View 1 Replies View Related

Using VBA To Hide And Unhide Multiple Columns?

Dec 1, 2013

I have a worksheet with a fair amount of data. It is split into two parts: the main part is a table with data in columns D to AR while the other part is simply a list with checkboxes against each item. I have set things up so that when a checkbox is ticked against an item in the list, then a 2 appears in row 2 above the relevant column in the main table; if the checkbox is unticked then a 2 appears above the relevant column.

What I seek is a macro that will hide all columns that do not have the associated item ticked; in other words, I want columns to be hidden if there is a 1 in the relevant cell in Row 2 (and visible if there is a 2 there).

I have used the following code (obtained from this forum), but it doesn't work as expected. When I select the items, the cells in Row 2 react as expected, but the hiding and unhiding only occurs when I go to another Worksheet and then return to the Worksheet where the data is. Obviously I want the macro to work immediately I tick or untick a checkbox. What is wrong with the code I have used?

Private Sub Worksheet_Activate()
Call HideCols
End SubSub

[Code]....

View 6 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

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

Hide/Unhide Multiple Sets Of Columns With Toggle Button

Sep 23, 2009

I am trying to create a very large spreadsheet and i have got everything organized, but for easy viewing i want to have a toggle button that hides and un-hides certain sets of the columns (ie. Press down and it hides columns "B-F", "H-J", and "M-O".... then on depress it shows all the information again)

I have got some of the coding down, but am only able to get it to hide one set at a time, not all the sets. Can anyone help me out and let me know how i tell it to run multiple commands from the one press? here is the code i have already: ...

View 6 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

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

Choose Item From Dropdown List - Populate Multiple Parts And Their Prices Below

May 26, 2013

I would like to be able to choose a Size from a drop down list.

After choosing the size, the Parts and Price records (rows of data) will populate below a few cells.

I will manually insert the Quantity amount of items I need,

This will calculate the total from the cells (price & Qty).

View 7 Replies View Related

Automatically Select Item From Dropdown List Based On Cell Text

Apr 8, 2013

I have a spreadsheet where user can search for information inside a search box and the appropriate rows are returned using formulas.

I have a drop down list (Category: Model) in the search box as well as a search field (Category: Program, cell D2). Underneath the search box, search rows are returned with column categories: Program, Model, etc.

What I require is that if a user enters the specific program into the search field D2, then the dropdown list would automatically choose which model that program belongs to based on the returned row.

For example, if I typed "engine" into D2 and pressed enter,

Under the records section (Row 14 and beyond), the following record will pop up:

Program
Model
Indicators

Engine
F-16
3a

Based on the record, F-16 would be chosen from the dropdown list. Is there any way this can be done?

View 6 Replies View Related

Set Value Of ComboBox Based On Chosen Item From Another

May 15, 2008

I have two comboboxs on a userform, both are populated like this:
(ComboBox1 is a different sheet/column)


' Sets Remarks in ComboBox4 Contents
With Worksheets("Data")
Set rng = . Range(.Cells(1, "C"), .Cells(Rows.Count, "C").End(xlUp))
End With
With ComboBox4
.RowSource = rng.Address(external:=True)
End With
The function is that ComboBox1 will populate the names on lets say Sheet1, Column A, and when selected will populate by offset all the other Textboxs, and ComboBoxs.

Textbox1 is a date
ComboBox4 is populated off of items from the data sheet
ComboBox1 is populated off of sheet1 and provides names, then fills the userform fields

In populating the Userform, it fills Combobox4.value by the offset value of the selected name.

That cell does not contain the same info that was loaded into the ComboBox initally, and it does not show it. All other ComboBox entries match preloaded values, and show.

How do I get the ComboBox to display what is in the OffSet cell value, rather than blank because its different?

View 9 Replies View Related

Fill ComboBox Based On Item Chosen In Another

Sep 8, 2006

Not overly familiar with ComboBoxes but what I want to do is load a ComboBox with data based upon the selection of another ComboBox

Please see attached example.

ComboBox1 - I can get to load.
ComboBox2 - I want to load but only those lines that match the above selection
TextBox - Load with the data on row selected by ComboBox2

View 9 Replies View Related

Color ComboBox Based On Item Chosen

Sep 27, 2007

Is it possible to have a combo box in excel, where, when an item is selected, it is assigned a colour depending on which item it is? Eg, The combo box list has item 1, and item 2. If I select item1, then the text becomes red, if I select item 2, the text becomes blue. If not possible using combo box, what method can I use?

View 2 Replies View Related

Macro To Hide/Unhide Worksheets

May 3, 2007

Develop a macro that will enable me to hide or unhide worksheets.

Basically, I have a few worksheets in my workbook and I want to have a page at the front with two buttons. One for Unhide sheet and the other for Hide sheet. Once activated, I want it to give me a list of worksheets that I can click to hide or unhide (depending on the button i click).

View 13 Replies View Related

Hide / Unhide Worksheets With Buttons?

Dec 3, 2011

I have a button (A) that will unhide worksheet A. I would like to add another button (B) that will hide(very hidden) worksheet A (if allready open) then open worksheet B, vice versa when click button A.

Code:
Sub ShowSheets()
With Worksheets("A")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
End Sub

View 5 Replies View Related

List Values From Multiple Columns In A Dropdown List

Dec 17, 2012

how to list values from multiple columns in a dropdown list based on lookup value of 1st column as below.

This is how the table looks like.

Product MOLD1 MOLD2 MOLD3
4" AB1 AB2 AB3
6" ZA2 zd4 -

This is how the dropdown list should look like for Product 4"

ab1
ab2
ab3

View 6 Replies View Related

Excel 2010 :: How To Hide And Unhide Worksheets

Oct 4, 2013

I have an Excel 2010 file with 10 worksheets. I would like to set up two VBA codes to attached to a two button; one to hide specific worksheets, the other to unhide. The specific worksheets are:

Calculation Sheet
GL Receipt
Sheet2

View 5 Replies View Related

Dropdown List From Multiple Columns

May 28, 2013

I am trying to make a single drop-down list which contains values from two columns.

I should give you the example immediately:

NAME | SURNAME (these are two columns)
Jon | Alfa
Karl | Beta
Lilly | Wolf

And the drop-down list should look like this:

DROP-DOWN
Jon Alfa
Karl Beta
Lilly Wolf

I have already tried to solve my problem with data validation but with no success.

View 2 Replies View Related

Hide Or Unhide Worksheets From Cell Values In Sheet 1

Feb 18, 2009

I want to set up a few workbooks with 11 sheets. Sheet 1 will in effect be an index, with True or False values in say cells D5:D14. The True/False values will be generated by form control check boxes in some of the workbooks and by IF(TODAY()>xxxx formulas or similar in other workbooks.

I then want to be able to hide or unhide sheets 2-11 based on the True/False values in cells D5:D14 in sheet 1.

View 7 Replies View Related

Adding Multiple Columns For Dropdown List

Mar 5, 2013

I'm trying to set up a billing form for my work. I'm trying to include drop down list for each sections (personnel, equipment, and supplies), then all sum together as a bill. I'm not sure if this is doable in excel.

View 9 Replies View Related







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