Filtering - Capturing Additional Rows Daily?
May 2, 2012
I have a VBA code that captures auto-filtering based on two criteria, but the problem is, the spreadsheet I am working on changes the amount of rows daily (ie: more rows are added onto it).
How can I change my code such that it doesn't fix the filtering area to a certain date's row #'s?
The code is
Rows("6:6").Select
Selection.AutoFilter
ActiveSheet.Range("$A$6:$Q$108").AutoFilter Field:=11, Criteria1:=
"2017708007"
ActiveSheet.Range("$A$6:$Q$108").AutoFilter Field:=5, Criteria1:= _
xlFilterYesterday, Operator:=xlFilterDynamic
View 3 Replies
ADVERTISEMENT
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
Jan 29, 2014
I am using a spreadsheet as a score sheet for a competition. One of the columns is the student's GPA. After entering all the scores there are duplicate final scores. I need a way to have it look at the final score and then use the GPA so that it will not put a duplicate value in the final column.
al Column N is the Total Column, Column O has the Names that correspond to the Total Column. Currently I am taking this total and putting it into Column Q (High Scores) in high to low order. Column R should have the names that match the scores. But with duplicate scores, it is only putting the first name associated with the score. I would like to use the GPA as a final determining factor for the duplicate scores. The higher GPA would come before a lower GPA. I have tried to put an additional column to bring the GPA over to correspond with the High Scores Column, but could not get it to work.There are actually more names for the competition and the top 10 will be moved to a different sheet and further judged. I have attached a sample with the exact formulas that I am using.
View 1 Replies
View Related
May 25, 2013
I'm not great anyways with VBA Macro.Effectively, here is my issue. I have a spreadsheet which is really badly designed.In one column I have multiple numbers separated by a comma. I need this data separated into new individual rows, but at the same time, copying the data in the other columns in that row to the new row.
Example of what I have:
Test 1 54 email1
Test 2 32, 343, 63, 34 email2
Test 3 4934, 5342 email 3
What I need:
Test 1 54 email1
Test 2 32 email2
Test 2 343 email2
Test 2 63 email2
Test 2 34 email2
Test 3 4934 email3
Test 3 5342 email3
I have have the following code below which paste everything into a new column and into a new row, but the problem I have is that it does not push the other rows data down, nor does it copy the 1st rows data (for that data set) into the new rows created.
Code:
Option Explicit
Sub Macro1()
Dim fromCol As String
Dim toCol As String
Dim fromRow As String
Dim toRow As String
Dim inVal As String
Dim outVal As String
[Code] ........
The amount of rows I have, so this manually (text to column, then transcoding etc) it out of the questions (i have 1000 rows of this!)
View 7 Replies
View Related
Jun 3, 2014
create a macro that will insert a certain number of blank rows to my spread sheet. The number of rows is determined by the #of tasks calculated for that day and is in column B. For example if in column A the date is 01-07-14 and in column B it has 7, I would like 7 rows inserted with the date in column A to remain the same in all 7 rows. Ideally I would like to use this macro for every row, so if the next row down has 02-07-14 and 6, I would like it to add 6 new rows with the same date.
I have attached a copy of the spread sheet for reference.
View 4 Replies
View Related
Mar 20, 2014
I have the following scenario:
Cell A1 shows a specific value (pivot table value), but same A1 cell value might change if pivot table is refreshed.
So I am trying to automatically copy A1 value to another cell but I need to keep track of each value when pivot table is refreshed.
I have been researching about =Value formula, but it does not work properly since A1 cell reference will change each time pivot table is refreshed.
View 4 Replies
View Related
Oct 24, 2007
I have a very long excell sheet and I want to be able to have two buttons off to the side that allows me to filter and unfilter my page. What I want to accomplish is if the cell in column "A" is not populated then I do not want to see that entire row when I filter.
View 4 Replies
View Related
Nov 3, 2006
i have a table with game results like: ...
View 9 Replies
View Related
Dec 12, 2009
I have a module that imports data from a text file (120000 rows), filters and removes some unneeded (85000)rows and then puts the data in a designated workbook.
Problem: when filtering by some criteria it for some reason removes a row off the final file for each criteria. I have a total of 23 filtering criteria. I have attached a file for exemplification. You can run the module and import the file, it will be without first 23 rows, even if non of the deleted rows contained the filter criteria.
example.txt
View 11 Replies
View Related
Mar 10, 2013
How can I use a pivot table or advanced filter or macros to view rows by
Only today’s date (1 row) ?Only this week ?Only last week ?Only last month ?Only last 12 months ?All dates ? That is, rows are headed by day. I select the rows that I view.
View 2 Replies
View Related
Dec 3, 2013
I have a macro that filters a column with varying criteria.
Row 1 has all my column headings.
What I would like to do is copy the 5 rows in view below Row 1 after the filter is applied.
View 1 Replies
View Related
Aug 19, 2008
I've got a row of data with a column showing some sales including amounts with 0. Any row with 0 I want gone, so I want the macro to filter the list, delete all the rows with 0 in that column, and then display what's left, all the rows with some number other than 0 in that column.
The code below should filter the 0 rows, delete those rows, and then display what's left. I don't want the heading row deleted, but everything below it that is filtered. What my code below is doing now is not deleting everything it should. How can I fix it.
Sub prepmetrics()
'
' prepmetrics Macro
' for use with monthly report - don't forget the new coversheet
'
Application.ScreenUpdating = False
Range("A7").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:="0"
' this is the challenge here. How do I tell Excel to select, relatively, whatever
' rows are now showing as a result of the filter?
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
ActiveSheet.ShowAllData
' there may be a number of different criteria in different columns, so
' we rinse and repeat as many times as necessary but, again, each filter/delete
' task should delete all rows filtered
Selection.AutoFilter Field:=16, Criteria1:=">7500"
Selection.Delete Shift:=xlUp
ActiveSheet.ShowAllData
Application.ScreenUpdating = True
End Sub
View 9 Replies
View Related
Apr 3, 2007
I have been trying to transpose a piece of code that was put on this forum back in 2005 into my own Workbook but have been unsuccessful. The original piece of code filtered a column for unique entries and then filtered the main sheet for each unique entry and cut and paste each row that the unique value occurred in and in a new worksheet. A new worksheet would be created for each unique filter.
So what I am trying to do is look up a list of values that i have in a list on the worksheet. Then for each entry in my list, create a new page and cut and pasted the filtered main worksheet into that page.
Finally return to the main worksheet and then remove all filters.
I have attached the original file that was submitted so you can look at how it works and I have posted a sample my worksheet (with some things disabled to reduce file size but hopefully you will get the layout. However I don't currently have that sample on this computer. It is posted on another thread under the title "Selecting rows with specific values in a column".
View 5 Replies
View Related
Dec 1, 2009
I have filtered a worksheet and want to only total the data in the columns that are visable, is this possible?
View 4 Replies
View Related
Apr 26, 2012
I have a 'dump' of a general ledger accounting system....about 20,000 rows. Column A contains the journal number for each set of transactions (there are usually two rows in each set but sometimes three), column C contains the name of the account, and column E the amount. For example:
Row 269 cell A269 = 487 (journal number) cell C269 = Cheque, cell E269 = $50
Row 270 cell A270 = 487 (journal number) cell C270 = Travel, cell E270 = -$50
What I am wanting to do is to extract the sets of journal entries, where the account name (in column C) is "Cheque"....so I would want to extract rows 269 and 270 based on the above example. If I filter using the account name it only gives me one row for each journal transaction - only half of the story. Given that the journal number links the two rows.
View 3 Replies
View Related
Feb 4, 2014
I have a spreadsheet of raw data that has been downloaded in Excel. In Column N there are different site numbers.
I want to use a new Sheet for each site. Using a formulae I want to filter the data for each site and then copy the entire row to the relevant site`s page.
So I should end up with a sheet for each page and allthe data sorted correctly?
View 3 Replies
View Related
Apr 27, 2009
First, I know passwords are easy to break. The point is only to keep the average Excel user in a dept of 3 from accidentally damaging the data.
Normally I hardcode passwords to view xlveryhidden sheets.
But this workbook is for a dept head who has standard password(s) he uses to open or edit a file. I would like to capture these passwords and make it the same password(s) to view a hidden sheet.
This way if he ever changes the password to open/edit it will automatically change the password to view the hidden sheet(s).
View 7 Replies
View Related
Aug 6, 2009
In the help file for MATCH it says:
If MATCH is unsuccessful in finding a match, it returns the #N/A error value.
So I am trying in vain to capture the error, but can't see where I am going wrong.
View 8 Replies
View Related
Feb 16, 2006
I have a spreadsheet that monitors the opening time of some stocks. In the
morning before trading starts it looks like this:
StockTIME
QQQQ-O2/15/06
AAPL-O2/15/06
GOOG-O2/15/06
CSCO-O2/15/06
SPY-A2/15/06
When trading starts, the TIME value records the time of the last trade, thus
the first time will represent the time of the first trade - I am trying to
capture this time value. The problem is that if another trade occurs, the
TIME value updates to the time of that last trade. The TIME value is fed by a
DDE link from a data source.
Is there a way to capture the "first" change in the TIME value ?
View 9 Replies
View Related
Feb 13, 2012
I have a worksheet which counts the entries of some orders via a barcode scanner.
What i would like to have is a progress bar showing graphically the percentage of completion of the progress.
For example in an 8 hour shift , 120 orders should be completed ideally.
The progress bar should show the actual status based on time and entries.
If the orders are processed on time the progress bar is green otherwise is red.
View 2 Replies
View Related
Jun 14, 2014
I am trying to make a program and in this program I am trying to use an offset. In that offset I want the column offset be = to a Integer variable I have created but I am getting the "red text".
How can I capture the weeknumber integer, entered into the input box as the second offset variable?
Dim ForumMember As String
Dim ForumMemberRange As Range
Dim ForumMemberLocal As Range
Dim WeekNumber As Integer
'worksheet and book activation
Workbooks("Trivia Point Account").Activate
Worksheets("Game 3").Activate
[code].....
View 5 Replies
View Related
Feb 12, 2008
I have an excel model that cycles through several times and each time, changes the values in certain cells. What I want to do is to continuously add the values of each cell in my range and then paste the results on another worksheet.
My range of cells is B23:E93.
Say I want to run my model 3 times. I want to do the following calculation for each cell in my range and then paste the results:
First B23 = B23 (first value output)
Second B23 = New B23 + First B23
Third B23 = New B23 + Second B23
I then want to copy the results from the final run onto another worksheet named "All Resources." The range here would be B2:E72.
View 9 Replies
View Related
Aug 30, 2012
I have a macro that is starting to get pretty intensive and beyond my knowledge base. Currently is takes the needed data from sheet(1) and copies it to a newly created "Sheet2" in a specific format. Once the macro is done formatting "Sheet2", it shows both userforms for the next part of this macro.
One userform (UserForm1) is for inputting barcode data into rows on "Sheet2" (this is where I am running into problems). I cannot get the userform to capture the captions to the needed cells in "Sheet2".
The other userform (UserForm2) is for a visual representation of the error check. This will check for differences in Sheet2's column data. If a row's data in Sheet2 doesn't duplicate as expected it will flag RED and an image to show in the associated frame in UseForm2.
UserForm1:
Plate ID (PlateIDLabel goes to "PCR Plate ID" header column in Sheet2)
Plate Location (PlateLocationLabel goes to "PCRLocation" header column in Sheet2)
Currently the userform is coded to recognize prefixes for correct input into label textboxes.
Attached it the workbook with macro/userforms.
VB:
Option Explicit
Private Sub CommandButton1_Click()
Sheets.Add.Name = "Sheet2"
ActiveSheet.Move _
[Code]....
View 6 Replies
View Related
Dec 15, 2005
I have some values representing daily values belonging to a particular Week number. The week numbers appear from 1 to 6 times in the top row. I would like to get data pertaining to a particular week number (as entered in B10) from the array in the area shown in Light Yellow and from there, I would do some minor calculations to arrive at the required data..
In the sample, the week number 3 appears 3 times and is shown here. The first value I am able to get using HLOOKUP. Getting subsequent occurrences are the issue I have. I thought I will try and use OFFSET function based on the cell reference of the first occurrence of the week number to obtain the rest. I have not had any luck in that.
Basically, my issue is how to use HLOOKUP to obtain if the Lookup value is repeated in the range. Or should this be tackled using some other route?
The week numbers appear in a sequence and are not placed at random.
View 9 Replies
View Related
Feb 8, 2009
When reading a water meter in a large apartment building a meter reader can also click a timer (LAP) button as the meter passes preset intervals. The worksheet would record the "lap times" in separate cells which could then be compared and usage figures can be calculated, allowing the meter reader to know if there is currently a Leak or other problem before leaving the premesis.
In the attached worksheet you can see what I would like the meter reader enters the reading - the light green "Interval List" is created from that reading. The Meter reader then watches the meter clicking the LAP button each time the interval is passed, the current time is then stored to the Pink cells (Similar to the NOW() function), the times are then calculated in other cells like I did in the Blue column in this case showing elapsed time.
I have tried several ways to do this using NOW, but each time all the cells are updated to NOW not just the current cell - and the Single Button woulod be really nice so the meter reader didn't have to look away from the meter.
View 2 Replies
View Related
Oct 19, 2009
How do I capture keys sent to Excel when my workbook is open / active?
I know when you write a macro you can assign a shortcut key combo to it, such as "Ctrl-Shift-s", but I can't find where / how Excel stores that information, and can only presume it is stored away not accessible to the coder, (ie. not by going via the macro -> properties boxes).
My issue is I want to capture a key combo, then from that call a function passing a variable dependant on the combo pressed, eg:
View 11 Replies
View Related
Oct 2, 2011
I need the solution for the following:
1. Currently I have a randbetween() formula in cell B2.
2. Cell A1 = B2 (Every time the value in B2 changes so does the value in A1)
Instead, I want that every change in value in cell B2 is captured in progressive cells.
For example:
First iteration in cell B2, value is entered in A1.
Second change in value in B2, value is entered in A2, while value in A1 remains unchanged and so on and so forth.
View 1 Replies
View Related
Jan 3, 2012
I run a golf handicapping system that utilises excel quite heavily to record a LOT data over the course of a season. In essence we have in excess of 50 players who play once or twice a week and I record their Stableford scores (dont worry that's a golfing phrase but it is basically how they performed that day) and adjust their golf handicap accordingly - all in XL.
So - a player may start the season with handicap of 20 but over the season this will vary up and down as each score is recorded. A player may well play in excess of 50 rounds in a season.
I currently record the player's starting handicap in one column and in the next column appears the freshly calculated new handicap after a new score has been entered. The column containing the new handicap overwrites the old handicap value each time it is recalculated.
All I want to do is to create a 3rd column that records the lowest handicap value attained during the season. So for each player I guess it should take the newly calculated handicap and decide if it is lowest it has 'seen' in that column and if it is record it.
View 9 Replies
View Related
Apr 1, 2012
I am building an input tool in Excel and the aim is for people to add data which is then updated and inserted in the database. After this I want to show the user which data has been inserted correctly (green cell) and which has not (red cell with comment).
Wanted to know if there is an easy way to iterate through dirty cells in a range or I am going to have to do some before and after comparisons? For before and after I was thinking of having the start range address and then everything is an offset from here.
View 4 Replies
View Related
Jul 16, 2006
I would like to create a macro to enable a user to enter the number of copies to print, and then print that number of copies of a predetermined range in a spreadsheet. My InputBox routine works fine, but I don't know how to use the info I just captured. The code I have so far is as follows, but I guess I don’t know where this number is stored, or how to use it in a print statement. Needless to say, this routine doesn’t print the number of copies entered by the user.
Sub TestPrint()
' Ask user to input the number of copies to be printed.
Dim Message, Title, Default, MyValue
Message = "Please enter the number of copies to print" ' Set prompt.
Title = "Number of copies" ' Set title.
Default = "2" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)
Sheets("PaidOut").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
View 3 Replies
View Related