Yes Or No Question Hides Rows

Mar 19, 2012

I am completely new to using Macros in Excel. I have a cell with a yes or no question. If the answer to the question is Yes then I want rows 30-42 to be displayed. If the answer to the question is no I want rows 30-42 to disappear.

I have tried several different ways of doing this and no matter which one I use I get the same error. It says, "Argument not optional".

Here are the two different ways I'm trying to do accomplish my goal right now.

Attempt 1:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$BS$15" Then
Select Case Target.Value
Case ""
Rows("30:42").Hidden = False

[Code] ........

Attempt 2:

Private Sub Worksheet_Change(ByVal Target As Range)
For Each Cell In Range("$BS$15")
Select Case Cell.Value
Case vbNullString
Rows("30:42").EntireRow.Hidden = True

Code] ..........

View 9 Replies


ADVERTISEMENT

Macro That Hides Rows

Sep 7, 2008

I have a sheet that has the ability to display information for 60 employees, but most of the time there is only 25 - 30 employee row being used.

The sheets starts are row 1 and goes to row 60. A61 has a formula that counts how many employees there actually are and where the last employee is. (example: if A61=32 than I need to hide rows 32 to row 60)

View 9 Replies View Related

Hides And Unhides Certain Rows In A Worksheet

Feb 21, 2008

I have a macro that hides and unhides certain rows in a worksheet based on what number (1-10) is entered in a cell on that same worksheet. I have this same macro in different worksheets hiding/unhiding different rows based on this same number. So here's the problem: right now I have a number entry cell on every worksheet. I would like to only have it entered on 1 worksheet, with the rest of the macros reading the cell from that 1 worksheet.

View 11 Replies View Related

Hides Rows If Cell In Column Empty

Jan 10, 2007

I currently have a worksheet with a range of A1:P2500. I am trying to create a macro that will check every Row to determine if Column A is blank (""). If Column A is blank in this row, It will hide this row and then continue to the next, until all 2500 rows have been accounted for.

View 4 Replies View Related

Loop Through A List And Hides Rows That Doesn't Contain Value Of Textbox

Nov 26, 2011

I have the below code that loop through a list and hides rows that doesn't contain a value of the Textbox, it works fine but becomes very show where number of records it passed through the loop is greater than 1000, is there more efficient way of writing this code?

Number of cells to loop through is 10000 Max

PHP Code:

Private Sub tboxSearch_Change() 
LastRow = Cells(rows.count,5).end(xlup).row 
For Each cell In Range(Cells(55, 5), Cells(LastRow,5)) 
If InStr(UCase(cell.Value), UCase(tboxSearch.Value)) = 0 Then 
Rows(cell.Row).EntireRow.Hidden = True 
End If 
Next cell 
End Sub 

View 8 Replies View Related

Macro Identifies FULL ORDERS And Hides All Other Rows

Jul 25, 2007

macro - show rows ONLY if two columns = each other AND......
Hello Excel Swammis!

I am in need of your assistance again.

I have an Excel report set up as follows:

Col D - Order #'s
Col G - part #'s
Col H - warehouse code for each part # ("N", "M", etc...)
Col K - Qty of part # ordered
Col L - Qty reserved for that part # on the order

List of orders starts on row 9.

If a particular line on the order is filled, then Col K = Col L for that row.
When the whole order is filled, then Col K = Col L for all rows on that order.

What I need is a macro that identifies FULL ORDERS and hides all other rows. So, if Col K = Col L for all rows adjacent to same order #'s in Col D (AND if Col H has value of "N" or "M" for warehouse code), it will be visible. Any orders with even ONE unfilled line will be hidden.

I am also looking for the reverse of this for a seperate macro. IE: Any orders with even ONE line not completely filled, I want all rows for those orders to be visible and all else hidden (again, only if Col H = "N" or "M").

View 9 Replies View Related

Unchecking A Checkbox Hides A Sheet

Oct 3, 2007

Code that will make it so that when a checkbox is UNCHECKED, the sheet that it originally opened re-hides itself? In other words, I have a mcor that works great that allows for a checkbox when checked to unhide a worksheet and take the user to that sheet. Now I need it si that when it is UNCHECKED, the sheet goes back to it's hidden state. This is what I currently have that UNHIDES it. Obviously somehow I need it to REHIDE it after being unchecked:

How would the corrected code look AFTER being added to this one:

Sub CheckBox615_Click()
Sheets("FedEx Freight Opp Form").Visible = True
Sheets("FedEx Freight Opp Form").Select
Range("B16").Select
End Sub

View 9 Replies View Related

Code Hides The Arrow In Column

Mar 11, 2009

I have a sheet that is autofiltered. Once a user autofilters columns 20, I would like to hide the arrow for that column so the user can no longer autofilter using that column. When I run the code - it hides the arrow in column 20, but then it unfilters all the data . . . can I hide the arrow in column 20 but keep the data as it was filtered before the code ran.

Dim c As Range
Dim i As Integer
i = Cells(2, 1).End(xlToRight).Column
Application.ScreenUpdating = False

For Each c In Range(Cells(2, 1), Cells(1, i))
If c.Column = 20 Then
c.AutoFilter Field:=c.Column, _
Visibledropdown:=False
End If
Next
End Sub

View 9 Replies View Related

Macro Hides Userform Without A Reason

Mar 25, 2007

to ensure the user ends up looking at UserForm5 after having closed the UserForm2 with the x sign.

It works just great - the user gets logged on and can use the UserForm2 but when he/she closes the form with the cross and tries to lo on aner using the UserForm5 - which pops up autmatically due to the above code, both of the UserForms get cloed (or hidden).



Private Sub CommandButton1_Click()

Dim popup As Variant

If ExecuteExcel4Macro("'D:[target.xls]Trg Info'!R1C255") _
= UserForm5.TextBox2.Value And ExecuteExcel4Macro("'D:[target.xls]Trg Info'!R1C256") _
= UserForm5.TextBox3.Value Then

With UserForm5

.TextBox2.Value = ""
.TextBox3.Value = ""
.Hide

End With

UserForm2.Show

With UserForm2 .....................

View 9 Replies View Related

Paste Rows Without Overwriting Other Rows (automatically Shift Other Rows Down)

Jan 3, 2010

The number of rows you are pasting and then you can select that same number of existing rows and use "insert". This is what I'm trying to achieve:

(before paste)
A
B
C

(after pasting unknown number of rows)
1
2
...
n
A
B
C

Is there really no built-in way to do this?

View 6 Replies View Related

Identify Duplicate Rows And Copy / Paste First Cell To All Cells Of Equal Rows

Apr 14, 2014

I am new to macro and just trying to learn. I have a spreadsheet with 20000 rows and 8 columns. I am trying to identify equal rows based on the values of columns C, D, E and F. then I need to separate equal bunches with a blank row. Then I need to copy the ID number from the first cell of column B of each bunch and paste it for the rest of the rows in that bunch. I have written the following code but this does not put the ID of the first cell in a bunch for the rest of the rows in that bunch.

[Code] .........

View 10 Replies View Related

Excel 2010 :: Delete Filtered Rows Without Deleting The Hidden Rows?

Sep 25, 2012

How do I delete filtered rows without deleting the hidden rows in excel 2010?

View 8 Replies View Related

Excel 2010 :: Extend Rows Based On The Number Of Rows In Another Sheet

Jun 16, 2014

calculate the number of full rows in one data base located on one sheet X to determine how many rows the macro needs to extend on sheet B (sheet B is made only of formulas for data interpretation in sheet A.

View 14 Replies View Related

Clear Rows Vs. Deleting Rows To Avoid #REF! Formula Error - Macro

Jun 9, 2009

I have a macro which is copying data from several worksheets into one consolidation worksheet. When determining where to paste the data into the consolidation sheet, the macro includes some logic to find the last row that has data in it (using e.Range("A65536").End(xlUp).Row, where "e" is a variable holding the name of the consolidation worksheet).

Once all the data is on the consolidation worksheet, I have a second worksheet with formulas that link to the consolidation sheet. The issue I have is that the first step of my consolidation macro deletes all data on the consolidation sheet to ensure that no data is double-counted). I am deleting the data with logic that simply deletes all rows from 3 to 65536. Once these rows are deleted, Excel returns a #REF! error on my second worksheet which is linking back to this data.

Rather than deleting the rows on the consolidation sheet, I have tried using the Clear and/or ClearContents commands instead. This works (i.e., my formulas no longer error out), but results in the consolidation macro running very slowly (~15 minutes, compared to

View 9 Replies View Related

Maro, Insert Rows Where Rows Determined By Number Of Carriage Returns

Feb 17, 2010

The best way to explain my problem is to look at the table below:

How it looks now: ApplePrice 1
Price 2
Price 3FruitDeliciousPearStore 1
Store 2FruitVery DeliciousHow I want it to look:ApplePrice 1FruitDeliciousApplePrice 2FruitDeliciousApplePrice 3FruitDeliciousPearStore 1FruitVery DeliciousPearStore 2FruitVery Delicious

View 9 Replies View Related

Excel 2013 :: Averaging Rows Of Data Within Larger Blocks Of Datasets - Skipping Rows

Jul 16, 2014

I am trying to average different rows and columns within a larger block data set in a series. This data is from a 96-well absorbance microplate reader experiment. I only mention this to describe the raw data output I am dealing with.

Each set of data is in a 12 x 8 block with the next block below it with one blank row between. So I have a block of data contained between A1->L1->L8. The next block is contained between A10->L10->L17. This continues for a total of 28 blocks.

I want to take averages from rows or columns from each block and autofill them into a single column. So for example I'll need =Average(A1-C1) with =Average(A10-C10) below it and so on and so forth. My problem is that if I try to autofill from this already started column the third row will take the average of A2-C2 instead of A19-C19.

Is there a formula/script for me to skip the correct number of rows to the next data block?

I have attached my spreadsheet to this thread. I am using Excel 2013

FeS_Kinetics.xlsx

View 1 Replies View Related

Error In Filtering Table - Additional Rows Shown / Rows Hidden When Filter Removed

Mar 4, 2014

I have an excel file with a table in it. It contains 2051 records (attached). This is just a sample, the original file has around 30,000 rows.

When I start using filters, I run into problems:

Step 1: Filter by Unit, condition (e.g.) Unit_23
Excel shows in the status bar the following message: 437 of 2050 records found.

Step 2: If I scroll to the bottom of the table, the row numbers are colored in blue (normal for a filtered list) however the last row is not colored and it actually should not be shown since its unit is not what I filtered for (its unit is Unit_25)

Step 3: Clear the filter of Unit

Step 4: Sometimes (depending on what I filter for), one or more of the bottom rows are hidden!!!

Attachment 301726

View 4 Replies View Related

Macro To Copy Rows Based On Moving Date And Paste Rows Into Identical Sheet

Jan 28, 2014

I need to build a macro which copies 3 rows every day and pastes the row data into an identical sheet. The three rows will have column "D" as =today(). As the days progress the three rows will change accordingly ( tag to the today's date)

e.g. 28/1/2014
28/1/2014
28/1/2014

I need the macro to recognize the date when pressed and copy the corresponding rows of data and paste them into an identical sheet with the same date. The second sheet is an archive sheet. The date will tick over as per the calendar.

View 9 Replies View Related

Macro To Split Rows Into Groups Of 5 And Insert 3 Blank Rows In Between

Feb 9, 2013

I would like to have my macro code search column A (supplier numbers) and split the rows into groups of rows of 5 or less and then insert 3 blank rows between each group of rows. The split needs to start on a new supplier number and cannot split a supplier number into two different groups. Here is a sample:

Supplier
Invoice Date
GL Date
Invoice Amt

[Code].....

View 1 Replies View Related

2 Rows Of Data For Individuals In A Population - Attempting To Average The Rows?

Apr 30, 2014

I am an undergraduate biology major working on a geometric morphometrics project. It is focusing on wing asymmetry, so I have data for the left and the right wings for a sample population of 30 individuals. The data from the software is exported as a spreadsheet with two rows of data for each individual, since each wing was calculated separately, and my mentor has asked me to average the data for subsequent analyses in another program.

I'd like to do this easily with an Excel formula, but when I try to do the averages I'm having a little trouble getting the formula to carry on correctly. I need it to average, say, E2:E3 then the next cell average E4:E5, but instead the only thing I can get it to do is average E2:E3 then the next cell do E3:E4. Which obviously doesn't work for me, since E3:E4 is data from two different individuals.

Is there a way I can do this for my data? One of my spreadsheets is a 60x32 matrix of landmark coordinates, so I'd really rather not try to do all the cells individually.

View 1 Replies View Related

Pulling Rows From Other Sheet - Skipping Over Rows If Column Is Blank

Jan 17, 2014

I am working in the attached spreadsheet. For anyone who does not wish to open the link, let's say these sheets are titled 'Sheet1' and 'Sheet2'.

Sheet2 looks like this:

Year Cat Name
2013 4 Sal
2013 4 Pat
2013 3 Pat

[Code]....

Now, how may I pull this data into a summary sheet (Sheet1) that skips over any instances where column A ("Year") is blank so it looks like this:

Year Cat Name
2013 4 Sal
2013 4 Pat
2013 3 Pat
2013 2 Pat
2013 5 Bob

[Code]...

Note: All columns are the EXACT same across each sheet(including Sheet1, Sheet2, Sheet3), if that extra piece of information works.

PS It is fine if, in order for a formula to work, I need to copy and paste the formula for the length of rows per each Sheet to consolidate.

EDIT:

So, in my industry, any summary-level data (shown on Sheet1) must have a linked reference to a particular sheet (Sheet2, Sheet3, etc.) so the user knows where the raw data came from. This is to ensure increased accuracy of data and minimize human error (like, if for example, I accidentally didn't copy and paste all the rows correctly).

I have uploaded the actual sheet to show what the data actually look like. I am trying to pull in 2013 data into my "Summary Page" and would like to have all the data linked to the '2013' sheet but skip any blank rows.

Here is my failed formula:

=INDEX('2013'!F$3:F$338,SMALL(IF('2013'!$E$3:$E$338<>"",ROW('2013'!$E$2:$E$338)-ROW('2013'!$E$2:$E$338)+1,ROWS(B$1:B1)),""))

View 14 Replies View Related

Moving Data From Rows To Columns And Delete Repeated Rows

Apr 16, 2014

removing duplicate rows and move other data frm rows to columns.xlsx.

I am attaching a sample excel sheet showing what I need to do.In the first tab, I have a list that includes duplicate rows (first column only). I want to remove those duplicate rows but I don't want to lose the data in the following columns which can be unique or duplicates as well.

see the desired result tab in the sheet to get an idea of what I am looking for as the end result.

Keep in mind that the actual source file I am working with could have up to 50000 row, and the expected results could be around 2000 rows. So nothing can be done manually.

View 5 Replies View Related

1 Row Cell Covering 4 Rows But Next Column Divided In Separate Rows

Jun 5, 2014

I am working with an excel spreadsheet. There is a column for "name", and then the next column is for medical condition.

If the same patient has multiple (say, 4) conditions, the rows for "name" are combined into a single cell(let's say, a cell going from row 2 to row 5, witha a single name in the combined cell) , with the next column having four different cells adjacent to the single cell (cell 2 has "bleeding", cell 3 has "fever", cell 4 has "diarrhea", and cell 5 has "rash"). Some patients have only single conditions, single cells.

Will this mess up COUNTS and COUNTIF?

Is there a way to split the combined cell2-5 for ''name" into four cells all containing the same name?

View 4 Replies View Related

How To Delete Copied Rows And Update Original Tab Without Empty Rows

Apr 3, 2014

In my excel I'm copying rows upon specific criteria to another tab.

The question is how I can delete copied rows and update the original tab without empty rows? (N of rows is always changing)

View 14 Replies View Related

Hidding Rows With Checkboxes And Coping Visible Rows To Another Sheet

Oct 15, 2008

1. I have to hide rows using checkboxes
2. I have to copy visible rows (not marked ones) to another sheet in the same workbook. So far i have managet to creat this code for hiding/sowing rows:

View 4 Replies View Related

Count Rows Including Blanks Omitting Hidden Rows

Apr 18, 2013

I have data in B4:B55 and need a formula to return a count of rows, including rows that are blank. However, there are hidden rows that need to be omitted from the count.

View 1 Replies View Related

How To Dynamically Insert Rows With Duplicate Data Of Previous Rows

Oct 30, 2013

I have a spread sheet with values in the area of A1:H834

In column H, I have number values from 1-7.

Essentially that number value means that the values in the row are duplicate.

So, for example, if H2 has a value of 4, that means that $A$2:$G$2, really should have an additional 3 rows underneath with the EXACT same data in each cell, however, the way the sheet was created, was to remove the duplicate values and just indicate in column H, the number value of how many duplicates $A$2:$G$2 really is.

I need to unpackage this and create what it was originally. What type of formula can I use, to look at the value in H2, and then insert underneath that number of rowes with the exact same data as A2:G2 and do the same for the remainder of the table all the way down to A834:G834

View 1 Replies View Related

Find Duplicates In 1 Col Then Copy Entire Rows Of These Duplicate Rows?

Feb 2, 2014

The below code compares the Data in a Field that must be set and collect the duplicate Values in a second Worksheet.

The thing I want it to copy the rows, when a duplicate is found in Col A. editing the code below:

Original Sheet:
"A" "B" "C" "D"
Teil1A11000
Teil1B21001

[Code]....

View 7 Replies View Related

Macro To Separate Lots Of Rows With Certain Amount Of Blank Rows

Feb 15, 2014

I have been using this macro to separate lots of rows with a certain amount of blank rows.

Example:

Code:
Sub test()
Dim j As Long, r As Range
j = InputBox("type the number of rows to be insered")
Set r = Range("A2")

[Code] .......

I trying to change it so that, instead of inserting how ever many blank rows, it just copys the row above.

Example (Row A to C)

I have been messing around with macro recorder and i could select each row and paste it into the blank rows, but from researching on the internet selecting and pasting data seems to be a waste of resources (ram?) and i will be running this on a couple hundred rows (lots of data). Also, i would like to keep the functionality so that i can still choose how many times it copys/inserts each individual row from a input box.

I eventually want the data to end up like it is shown in the table but i am takin it one step at time because i want to understand what the code is doing.

View 1 Replies View Related

Macro To Insert New Rows Based On Commas In Previous Rows?

Mar 15, 2014

I'm a macro novice and have been trying to teach myself how to write the correct one for a task I need to do, but I cannot seem to get it right. Basically, I have bunch of data and for one of the variables, different values are separated by commas. What I want is to create a row copying the info below for each piece of data after the comma.

Sheet1

A
B
C
D

[Code].....

I suspect there is a fairly easy way to do this, but I cannot figure it out from searching the forums (or rather, I can't get it to work right).

View 6 Replies View Related







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