Hiding Only Specific Rows Using VBA

Jun 15, 2012

I have a spreadsheet where I have a simple formula. The formula is IF($A2=$B$2,1,0), and then I drag down to the bottom of the spreadsheet, so whenever it matches it shows a 1.

Now, what I need to do using VBA is hide all the rows that do not have 1's on them. I know how to start the VBA, but not how to finish

Code:
Dim LR as Long
LR = Range("A2").End(xlDown).Row

Because that will allow me to only select the row field that I want to do the Macro on. So, how do I go about hiding rows that only have 0's in them.

View 2 Replies


ADVERTISEMENT

Hiding/unhiding Specific Rows Containing Zero

Jul 23, 2008

I would need two macros for one of my projects. I did search the forum, but I couldn't find anything what would suit my needs.

The first macro should hide those rows which would contain 0 (zero) in a specific column (in my workbook it's E). The secon macro should unhide the hidden rows.

Sound so easy ... but sadly I can't do it.

View 14 Replies View Related

Excel 2010 :: Hiding Rows In Pivot Table With Specific Value Range?

Jan 20, 2014

I am using a pivot table in excel 2010. 15 columns (fixed) and plenty of dive downs for rows.

I am trying to 'hide' all of the rows containing values less than 10. If it is easier we can start with hiding values of zero and go from there.

It is key to hide the rows as within the dive downs the rows within the pivot are to many to sort through. If there is a way to do this using the grand total columns for each row that would work as well. Just to be clear I need to hide the entire row not just report the empty cells as zeros. If any further detail is needed feel free to ask.

For example: If value of column O "Grand Total" = 0 'hide rows with value 0' ELSE 'display rows with value greater than 0'

View 4 Replies View Related

Hiding And Unhiding Rows In Multiple Sheets Based On Specific Cell Value With VBA

Jan 4, 2013

I am trying to find code that will allow me to hide a set number of rows based on the value of a specific cell which I need to work for two worksheets in the same workbook. Is that even possible?

For example: when i enter 5 into cell D1, I need five rows to be visible on both sheets.

View 9 Replies View Related

Hiding Specific Cells Through Checkbox?

Apr 22, 2014

I'm looking to see if it's possible for me to leave information in specific cells hidden unless a checkbox is marked off. I do not need/want the entire column or row hidden (which I've found plenty of tutorials on via google)

I'll try to provide a basic example:

ie: Column A1: checkbox;;;Column B1: Dairy;;;Column C1: milk;;;Column D1: slim milk
Column A2: checkbox;;;Column B2: Poultry;;;Column C2: beef;;;Column D2: hamburgers;;;Column E2: bubba burgers (<--not a fan of them)

(the values in row C and D will never change - there are some instances where there are values in column E)

I need the checkboxes in column A and the information in column B visible at all times but C and D (and E) visible only if the checkbox is checked.

Here is an example code I tried creating myself (with .entirerow.hidden and .entirecolumn.hidden codes I found online). Obviously it didn't work lol, but I was wondering if there is a way to only get these specific cells to hide rather than an entire row/column.

Sub CheckBox1_Click()
If CheckBox1_Click = True ThenRange(C26, C27, D26, D27).Cells.Hidden = False ElseRange(C26, C27, D26, D27).Cells.Hidden = True End IfEnd Sub

View 3 Replies View Related

How To Show Userform Hiding Specific Workbook

May 19, 2014

I need a code (and where to put it) to open my application excel with only the userform so, with the workbook hidden.

Application.Visible=False doesn't work because it close all excels and moreover I can see the workbook for 1 or 2 seconds before hiding.

View 1 Replies View Related

Hiding Specific Column And Updating Information On Another Sheet

May 30, 2014

Check the attached sample file

a. actual data in columns is approx 150 items (that is why i need to hide/unhide columns)
b. there are about 120 persons whom above items are issued depending on expiry of life of item i.e. issue date plus number of months mentioned in row 3. for example if coat was issued to John on 5th Jan then it's life expires on 5th May and so on.

Now what i want

1. by clicking hide checkbox only that specific column should hide or if i click Hide All check box all column in range should hide.

2. as i enter issue date expiry of that item should automatically update on corresponding month sheet i.e for above example 5th May should automatically get entered in sheet May.

I have entered sample data manually in months sheet.

aJITCBP.xlsm

View 2 Replies View Related

Hiding Specific Columns Based On Drop Down Menu Value

Dec 17, 2009

I have this model I created where I have two tabs. One tab is an input tab using validation and drop down menus and the other is a display tab. I simply want to hide certain QTRs based on the value of one of the drop down menu results. I tried writing the VBA code below but am a novice when it comes to code. Can somebody please help me fix the below code so that it works properly.

Public Sub hide()
If Worksheets("input").Range("b14") = "Q1" Then
Worksheets("Group P&L").Columns(c, d, e, h, i, j, m, n, o, r, s, t, w, x, y).Hidden = True
ElseIf Worksheets("input").Range("b14") = "Q2" Then
Worksheets("Group P&L").Columns(c, d, h, i, m, n, r, s, w, x).Hidden = True
ElseIf Worksheets("input").Range("b14") = "Q3" Then
Worksheets("Group P&L").Columns(c, h, m, r, w).Hidden = True
ElseIf Worksheets("input").Range("b14") = "Q4" Then
Worksheets("Group P&L").Columns.Hidden = False
End If
End Sub

View 9 Replies View Related

Code For Deleting Rows Verses Hiding Rows

May 25, 2013

The first code hides everything just fine based on the date in A1. When I change it to the second code to delete instead of hide it is leaving a bunch of rows that the 1st code hides. Both codes have the same search criteria.

Code:
For Each cell In Range("B8:B5000") If cell.Value Range("A1").Value Then cell.EntireRow.Hidden = True
Next cell

Code:
For Each cell In Range("B8:B5000") If cell.Value Range("A1").Value Then cell.EntireRow.Delete
Next cell

View 4 Replies View Related

Hiding Specific Sheets Along With Sheets Containing Specific Number

Dec 3, 2013

I have a workbook with the following sheets i do not want to hide called "Detailed Template", "INTERFACES", "STATUS".

I then have a number of worksheets which have their names as cell addresses i.e. "E4", "E5", "D4", "F4", "G7" and so on.

I would like to hide all worksheets (except the 3 mentioned at the top [which are sheets 1-3]) and any which contain say the value of '4'. This value is defined by a cell in the "INTERFACES" worksheet say 'A1' for example.

I want the macro to be able to automatically do this for which ever value is in 'A1'. So if it were to change to '7' it would hide every sheet that doesn't contain '7' in the name.

View 6 Replies View Related

Hiding Rows...

Jul 1, 2009

I have two command buttons, and need one macro that would hide all blank rows between columns "E" and "O" and from row 9 to 42, and then another macro that would unhide all these rows again.

View 2 Replies View Related

VBA For Hiding Rows?

Oct 29, 2012

I am building a real estate model. What I am trying to do is the following:

If I enter the number of tenants in a cell (let's say the number of tenants is 6 and the cell I enter this number in is cell J11), I would like 6 of 15 rows to be shown below (rows 46-60). Therefore, the 9 unused rows (rows 52-60) would be hidden from sight. Furthermore, if I entered the number 3 for the tenant count, excel would hide 12 rows (rows 49-60). I am sure that this is a VBA code.

View 1 Replies View Related

Hiding Rows With A Cell Containing 0

Oct 25, 2006

a bit of code so that when I open a sheet (which takes data from another sheet) it hides rows which contain a zero in a certain cell?

View 10 Replies View Related

Hiding/Unhiding Rows

Feb 8, 2010

I have a problem with hiding and unhiding columns. Is there a way wherein I can automatically hide the row(s) if the cell = "N/A" and will unhide if it's not equal to "NA". see the attachment Im using excel 2003 btw. You can see in Sheet2 to that it contains the table for the student grades. "N/A" means that they are not enrolled on that subject. While in sheet1, What I want to happen is that you will select a student name and below, it will automatically display the grades of the student on their enrolled subjects only. So, those fields with "N/A" will hide and when I update the value of N/A it will unhide.

View 5 Replies View Related

Hiding Rows Based On Value

Apr 22, 2014

The attached sheet takes information from another sheet in my work book (I am only providing the sheet I was to work with). I want all rows where the value in F is 0 to hide automatically.

Attached File : Book2.xlsx‎

View 3 Replies View Related

Hiding Blank Rows

Feb 1, 2010

I have had great success using this code to hide and unhide unused space, but for some reason this morning it broke. Most likely it is my error so I am looking for another solution to resolve the issue. What i would like to be able to do it hide an entire row based on a specific cell being blank. maybe that is what this code is supposed to do but like i said it broke this morning. the cell in ref in the code is unchanged, but i did add formulas to some other cells in the same row. this is why i am looking for a way to do the same thing but based on a specific cell being blank vs what is occuring now.

View 4 Replies View Related

Error 424 When Hiding Rows

Feb 2, 2010

I have some vba code that is used to hide any rows with the cell value of "Finished". The code is below. When I run this code I get a run time error 424 - Object Required. Can you please explain or help as to why I am getting this?

As a side point the data is loaded from an oracle database rather than from the sheet but every other function/code works fine.

View 12 Replies View Related

VBA Hiding Rows With Asterisks

Jan 1, 2012

I have a worksheet with 4000 rows and only 4 columns.

In quite a lot of the rows in column 2 there are asterisks (**'s).

I have to print out the report without these rows.

First i would like to hide the rows and print the report

Second i then need to delete the rows if there is no data in column 4

View 4 Replies View Related

Hiding Rows Based On Value?

Mar 27, 2012

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = Sheets("Sheet2").Range("A3") Then 'A3 is the cell where your Yes/no choice is
Select Case Target.Value
Case "Yes": Sheets("Sheet1").Range("A7:A22").EntireRow.Hidden = True
Case "No": Sheets("Sheet1").Rows("A7:A22").EntireRow.Hidden = False
End Select
End If
End Sub

View 5 Replies View Related

Hiding Rows Through A Macro

Dec 4, 2006

i'm having trouble hiding rows through a macro. In this case, i'd rather use a macro than use autofilter....

i would like a macro that does the followings...

1. for each row in worksheet (up until row 2000), if the value in the first cell = YES, then hide row, otherwise, leave row as is...

View 9 Replies View Related

Automatically Hiding Rows

Jan 11, 2007

in worksheet "sheet1" I have my inputs... in "sheet2" I have my outputs... my inputs could be anything from 1 to 1000 therefore my outputs would be 1000... on the output sheet, below the last line, i have a whole bunch of text and calcs that I will always need at the bottom... what i would like to happen is if I put in "sheet1" b2 a number, say 5, then "sheet 2" would hide rows 10 to 1005 or if i put in "sheet2" b2 say 925, it hides 930 to 1005...

I created a macro, but it doesn't work at all... and i want it to work automatically without me pushing run macro...

View 9 Replies View Related

Hiding Rows When Blank

Sep 25, 2007

how to hide rows that are blank as a result of formulas in that row returning "".

I have rows between A10 and A80 that I need to test for blank as above an automatically hide them if they are "". I need to redo this each time I view the sheet

Be gentle, I am just a VBA newbie and havent quite finished reading Bill Jelens excellent VBA book purchased on this site.

View 9 Replies View Related

VBA For Hiding/unhiding Rows

Sep 27, 2007

For data validation lists B27 to B30, if any of them is equal to "EBS via ULL" then unhide rows 31 to 42.
If any of the data validation list not equal to "EBS via ULL" then unhide row 44 and hide rows 31 to 42.
If "EBS via ULL" and any other product in the lists is selected, unhide rows 31 to 44.
If validation lists B27 to B30 are all equal to "Select Product..", then hide rows 31 to 44.
I would like to use the worksheets_change event.

View 9 Replies View Related

Hiding Sheets And Rows

Aug 8, 2008

Why this doesn't error but yet it doesn't work either.

Sheets("2 plans, 3 plans, 4 plans").Visible = False

Sheets("1 plan").Range("a26:a416").EntireRow.Hidden = True

View 9 Replies View Related

Hiding Zero Rows Lines

Jun 16, 2009

In the above format (Excel file) i have to hide all the Zero rows one by one.

Please provide me any formula or a macro through which i can hide all the Zero rows instantaly in one go.

View 9 Replies View Related

Hiding Of Empty Rows

Apr 26, 2006

How do I go about hiding empty rows in a separate linked sheet? To be more precise, I'm working on 2 sheets now. Sheet 1 would be the input sheet and sheet 2, the output sheet. For instance, there are 10 rows of data in Sheet 1, but out of this 10 rows, I planted data only into 4 rows. How do I ensure that Sheet 2 hides the empty rows (5th - 10th)?

View 2 Replies View Related

Hiding Rows Using A Combo Box And VBA

Aug 18, 2006

I have inserted a combo box on Sheet 1 with two options in the dropdown ('A' and 'B'). I would like to write a macro to assign to the combo box so that if the user selects 'A' from the dropdown, rows 1-3 are hidden on Sheet 2, and if 'B' is selected, rows 4-6 are hidden (with rows 1-3 unhidden). I have tried unsuccessfully to write any script that even comes close!

View 6 Replies View Related

Hiding Empty Rows Via VBA Code?

Jul 10, 2014

automatically hiding empty rows on my table... though the table has been referenced via string of formulas which I added up on my worksheet.. Some of the rows on my table are empty and I tried a VBA code on automatically deleting the rows but then I realized that if that certain 'referenced' string of that cell is not empty anymore, that would cause me much trouble.. so basically I need a code that would automatically hide the rows that displays a result of "" and unhides when it is not empty.

View 14 Replies View Related

Hide Images When Hiding Rows

Jun 22, 2006

I have inserted images into cells, but when I hide the column the images are not hidden with that column, they just get squished between the two cells next to the hidden cell. Is there a setting or way to tie the image to that cell so that it hides/unhides appropriately with the row?

View 3 Replies View Related

Hiding The Rows While Searching Data

Feb 19, 2010

I am looking for some help with my data, I have this excel sheet in which i have certain abbreviations and answers to some questions which we use on our daily job. Now what i want to do is create a search box on the sheet and find the matching Abbrevation on the complete excel. The trick here is to hide every thing else when i search for some thing and see only for what i want to see in order to not to get confused. I am attaching the excel to give an idea to what i am looking for.

View 2 Replies View Related







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