Query/ Remove Rows

Jun 20, 2008

I have data in a 3 column by massive amount of rows (10000+) periodically there is about 6-11 rows of 'header' data which needs to be removed. this is a report run monthly so doing this over and over drain time. I need to create a query that will find all of these rows and delete the entire rows.

View 9 Replies


ADVERTISEMENT

VBA To Remove Query Definition

Jan 29, 2011

My WB imports external data on file open

I want to extend my VBA code to uncheck "Save query definition" after the updated workbook is saved.

View 4 Replies View Related

Remove Characters Right Of Comma In A Web Query

Aug 7, 2009

I currently have a macro that imports data from a web-based query then deletes column A from the query. I do this because I am using a VLOOKUP on the data and the VLOOKUP value would be in column B if I didn't.

The website has changed the format and now once column A is deleted, I'm left with a format of FirstName LastName, POS TEAM (i.e. Tom Brady, QB NEP). My VLOOKUP looks for FirstName LastName so I'm getting the "N/A" error now. I need to remove the "," and "POS" and "TEAM" from the imported data. This would be easy enough if the number of characters right of and including the comma was consistent, but it isn't. (Also, text to columns then CONCATENATE won't work because VLOOKUP looks at values, not formula results...)

Now I know the formula =LEFT(A1,FIND(",",A1)-1) works, but how would I incorporate this into the worksheet to keep the values in column A and not add additional columns to throw off my VLOOKUP.

Ideally I'd like a simple macro to add to my current macro to use the above formula, but I'm not sure of the wording.

View 9 Replies View Related

Conditional Formatting On Different Rows With Different Query

Aug 20, 2013

I have the following data:

C D E F G
Jan Feb March Q1 TargetThreshhold
£ 2,067 £ 1,978 £ 2,161 £ 2,100 £ 2,310

£ 1,492 £ 1,422 £ 1,611 £ 1,600 £ 1,760
£ 2,718 £ 2,683 £ 3,263 £ 2,400 £ 2,640
£ 2,853 £ 2,335 £ 2,481 £ 2,300 £ 2,530
£ 1,412 £ 1,533 £ 1,526 £ 1,600 £ 1,760
£ 1,067 £ 1,133 £ 1,246 £ 1,400 £ 1,540

And I am wanting to use conditional formatting. But wondering if there is an easier way than what I have at the moment.

The Formatting im using is:

=$C4>=$G4 Where value is TRUE the cell returns red and this applies at the moment to the First Row.

Is there a way I can get Conditional formatting to recognise the next cells without typing for each set of rows.

aka Row B would Read =$D4>=$G4
Row C would read =$E4>=$G4

etc?

Id rather not have to do a conditional format for each row as I have about 50 rows of data to do this to

View 4 Replies View Related

Query Worksheet & Return Rows Based On Conditions/Criteria

Jun 1, 2008

I am trying to query a names sheet where each row may contain more than one occurence of a member ID. There are no duplicate rows ( records), because the dates are different for all rows.

1. I want to retrieve all of the rows from the names sheet that match a unique member ID. So far I only get one row.

2. And if mistype the number, it gives me a wrong record .I would like to get an error message that if I don't get a match, that it appears in the somewhere like dialog box or even entry in one of the cells that no name exits.

View 4 Replies View Related

Pass Parameter From Excel Through MS Query To MS Access Query

Nov 26, 2012

I have an MS Access query that contains a parameter. The parameter is a date field, and I have configured that in the Access query. If I run the query within the MS Access user interface, it prompts me for the paramater value as expected, and runs just fine. However, I want to connect to this query from within Excel as a data source.

I have created a connection to the Access file using ODBC from within Excel. In the MS Query window, I am merely selecting all of the fields resident in the MS Access query, and returning all values. In other words, there is no selection criteria in the MS Query. I have done this many times with Access queries that DO NOT contain a parameter, and everything works fine. However, in this instance, I need to pass a parameter through to MS Access in order for the query to run. At the moment, I get the "Too Few Paramaters...1 expected" error message. This makes sense, because I haven't figured out how to pass the paramater to MS Access.

Is there a way to structure this that does not involve VB code? If so, I'd love to know how. I have tried creating parameters in MS-Query with the same name, but although I get the prompt it doesn't connect with the Access query as the source for the parameter value.

If the solution requires using code, I'm good with VB Code in Excel...is there VB for Excel code that could make this happen?

Failing that, I guess there must be (I've seen a few in my search thus far) Access VB Code that can make this work. I'm very rusty using VB with Access, so this is my least favored solution. However, if this is the only option, keep in mind that I need to pass the paramater ultimately from a user who will initiate the process using Excel.

View 3 Replies View Related

Query Parameters Which Takes The Date From The Cell Into The Query

Mar 29, 2007

Need the query parameters which takes the date from the cell into the query. How should I modify my query if it needs to take the date from a cell?? The bold one date should be picked from one of the cell in sheet 2.

My query is this
WEB
1
http://fc-web-phl1-101.phl1:8090/gp/...runReport.y=12

Selection=15
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False

View 2 Replies View Related

Remove Many Rows At Once

Apr 4, 2014

I am using the following code to remove an entire row if a specific cell in that row contains "remove":

iLastRow = Cells(Rows.Count, "D").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Left(Cells(i, "D").Value, 4) = "remo" Then
Rows(i).Delete
End If
Next i

However, from what I can see, it starts from the bottom and look upward, removing each line as it finds it. The problem is, there could be upward of 500 lines that need to be deleted. This coding looks and removes lines one at a time and can take a while. Is there any way I can get this done faster?

During the previous steps of my macro, I sort the column (Column D) that has the "remove" in it, so all of the "remove"s are adjacent to each other in Column D of my file.

View 5 Replies View Related

Remove Set Of Rows

Oct 31, 2013

I'm puzzled on coming up with a way to delete a set of rows in Excel. I have two columns like below and would like to remove the rows with the later year. Is there a formula or vba I could use to run on 5000 records?

Current table:

Job Code Id
Resource Source
77224L HIMCO
MCL-INV-SUR12

[Code]...

Desired table: [this would exclude rows where record source = MCL-INV-SUR09

Job Code Id
Resource Source
77224L HIMCO
MCL-INV-SUR12

[Code]...

View 4 Replies View Related

Create An Conection With MS QUERY To A Csv And Query Data

Sep 6, 2008

I have a csv file on another drive on the network that i need to query. I believe that ms query would be the best way. I know that a DSN needs to be setup but this macro will be used by various users who wont know how to do that. thus I would like to create one via VBA every time the task needs to be run.
I haven't a clue how to do this and i need it to be explained to me in general terms with words of one syllable!

View 9 Replies View Related

Remove Unique Rows

Mar 29, 2007

How to remove unique rows from excel-table and leave only dublicates? any macros?

View 9 Replies View Related

Remove The Duplicates Rows

Jun 10, 2008

I have a customer database that is sorted by phone number. How do I remove duplicate rows.

View 9 Replies View Related

Remove Blocks Of Rows

Apr 27, 2006

I have a worksheet that collects information from another using complex formulas.

In column A I have codes i.e. PRD001A, PRD001B etc. A block of codes starts at A and can go up to Z. i.e. PRD001 could start WITH PRD001A and finish with PRD001N then there is always a PRD001W and PRD001Z to finish with.

PRD002A would follow PRD001Z and might only have A, B, W & Z codes before PRD003A.

In column K is the sum of columns D:J.

What I want is a macro that will look at column A & K and if all OR some of the codes for say PRD001 are >0 don't delete any of the rows for that group of codes.

Then look at column A & K and if all of the codes for say PRD002 =0 delete all of the rows for that group of codes.

View 9 Replies View Related

Remove Blank Rows In VBA

May 15, 2006

Sub Remove_E_H_Ts()
Application. ScreenUpdating = False
Dim x&
For x = Cells(Rows.Count, 2).End(xlUp).Row To 2 Step -1
With Cells(x, 2)
If Left(.Value, 1) = "E" Then ' i need to add If Left(.Value, 1) = "E" or "H" or "T" Then
.EntireRow.ClearContents
End If: End With: Next x ' after clear contents how can i remove blank rows ?
Application.ScreenUpdating = True
End Sub
i am trying to make this line of code work below....

If Left(.Value, 1) = "E" Or "H" Or "T" Then

then also after clear contents how can i remove blank rows ?

View 6 Replies View Related

Identify And Remove Rows Containing #N/A

May 25, 2006

I have a macro that performs Index&Match formulae on another workbook. This leaves me with some #N/A results. I then require the macro to delete all rows that contain #N/A. I have tried to identify these via

If Range("E" & myLoop).value = "#N/A"

and

If Application.WorksheetFunction.Isnumber(Range("E" & myLoop).Value) = False

but each one gives me a Run Time Error 13 (Type Mismatch) because, even though the results are now values and not formulae, it sees '#N/A' as an error (Error 2042).

View 3 Replies View Related

Remove Non-subtotal Rows

Nov 11, 2006

I have a large file and I am doing a subtotal here. I want to do further processing of the "subtotal" data (basically, I want to sort the list on the subtotalled sum values) and I would like to know if there is any method to delete all rows except the "subtotal" rows from the sheet other than the method described here, in another post in 2003.

Copy subtotals only - visible cells too complicated [SOLVED]

This works fine but I have the word Total in some of the columns I am sub-totalling.

Also, some of the entries in that column are very long strings to start with and when the subtotal is made by Excel, the details are truncated (probably to 255 characdters) and the word Total is not there.

View 7 Replies View Related

Remove All But 1st Of Duplicate Rows

Aug 12, 2008

ive got a spreadsheet with records such as this

james - smith - leeds- 01535 - 26/02/1983 - bd21 6ls
steven - smith - bradford - 213789 - 28/01/1982 - bd33 5th
james - smith - leeds - 01535 - 26/02/1983 - bd21 6ls
steven - king - manchester - 213789 - 28/01/1982
andrew - wright - bingley - 36473 - 12/01/1981 - bd23 689

what im trying to do is to check all of the rows for duplicates in such a way that (if any row has the matching colums 1,2,5 and 6 then all but 1 of the rows will be deleted.

i have a few thousand entries and am just trying to get rid of all the duplicate rows. The problem is that the duplicate rows are not IDENTICAL for instance soime of them may have spelling mistakes hence i cannot just do a straight forward if row = row then delete.

View 4 Replies View Related

Combo Box To Remove Mulitple Rows

Jan 12, 2010

I am attempting to design 2 combo boxs by which you can select from a number of equipment types and a criticality:

Equipment Types Criticality
Vac Pump 1A
Filter Dryer 2A
Valve 3A

I want to attempt to write a macro so that when the equipment type and criticality has been selected, a corresponding number of rows will disappear.

For example:

If Vac Pump and 1A are selected then all the rows from 70 downwards will be hidden, and if Filter Dryer and 2A are selected, then the rows from 6 to 38 and from 47 onwards will be hidden.

View 10 Replies View Related

Remove Rows Based On Value Of Dropdown Box?

Jan 30, 2014

I have a workbook with 7 different Sheets to pull data from. On Sheet 3 named "PMP Mileage Linear". I have 4 drop down boxes. In one drop down labeled "Drop Down 4" there are 21 different choices to choose from. Based on the choice I would like to hide or unhide Rows. Example: if a user chooses "3yr/36,000 Miles". I would like to hide rows 16:51. If a user chooses "3yr/60,000 Miles". I would like to hide rows 29:51 (hence un-hiding 16:28). If a user chooses "5yr/100,000 Miles" I would like only rows 41:51 hidden and so on until a user hits the max of 125,000 Miles (5,6 or 7Yr) whereas no rows are hidden. I would have attached the spreadsheet but I don't have permission from the people who own the data.

View 7 Replies View Related

Remove Duplicates After Updating Rows?

Feb 7, 2014

I have a spread sheet which has a range as shown below.

Batch NumberItem 1Item 2Item 3
P155635
P254
P378
P2568
P454
P389
P385

I need to get the output as shown below which is for Batch number P2 I need to include Item 1 (568) in one row and delete the other P2 row. similarly I need to do for P3. The end result will be as shown below.

Batch NumberItem 1Item 2Item 3
P155635
P256854
P3898578
P454

View 8 Replies View Related

Cannot Remove Alert Box When Deleting Rows

Feb 24, 2014

I can't get rid of the alert "Delete entire sheet row" using DisplayAlerts = False. Here is my code:

[Code] .....

View 4 Replies View Related

How To Remove YouTube Link From Rows

Mar 9, 2014

I need to remove the you tube link which is on some rows

Row 9:

[Code] .......

Attached File : Description.csv‎

View 10 Replies View Related

Automatically Remove Unwanted Rows

Dec 13, 2007

Im not strong in excel, that why Im here. So:

I work every day with big amount of item numbers and lists in excel and I need some macro or code to automatically remove rows, containing unwanted text.

Example:

MEMORY DIMM 512MB PC3200 DDR
MEMORY DIMM 512MB PC6400 DDRII
MEMORY DRIVE FLASH USB2 2GB
MEMORY MINI SD 2GB W/ADAPTER
MEMORY SECURE DIGITAL 2GB
MEMORY DIMM 1GB PC6400 DDRII
MEMORY DRIVE FLASH USB2 1GB
MEMORY DRIVE FLASH USB2 1GB

So I paste the text from my database, and want to automatically delete rows containing DIMM string. How can I do it?

p.s. is there also a way to leave only the rows I want?

View 9 Replies View Related

Loop Through Rows In A Listbox And Remove

Nov 20, 2008

I'm trying to loop through each row in a listbox on a userform and remove the value if it isn't equal to the year shown in a CBYear. i can't sem to figure out what to use in my for statement to point the VBA to the Row as it were

View 2 Replies View Related

Code To Remove Blank Rows

Dec 15, 2012

share a code to remove BLANK ROWS.

I have data on ROW#1, #5, #10...etc,etc.. I want to remove rows in btwn (which is blank) Instead of doing manually

View 2 Replies View Related

Remove Duplicate Rows Based On Col C

Aug 8, 2007

I am using three columns - Col A contains serial number, col B contains name and Col C contains Codes.

The problem is in col C as sometimes the codes are copied from other files also. So I want that if there is any duplicate codes in column C, on running the macro it will delete the duplicate rows and keep original record ie the duplicte records added later has to be deleted and that the original record will be in place.

View 9 Replies View Related

Remove Or Delete Duplicate Rows

Aug 24, 2008

I have 6 columns on my data sheet. F column is Amount column.

If there are rows where all the columns A,B,C,D and E duplicate then I need that row to be deleted, BUT before that the value from the column F should be summed to the duplicating row's F column.

I attached a simple example file, where you can see my point better. (I need the code to work with thousands of rows, and not only with 5 rows which i put on the axample)

View 9 Replies View Related

Remove Hidden Rows And Columns

Oct 25, 2006

I have a spreadsheet with various hidden rows and columns that I do not wish the user to have access too as it contains too much detail for their purposes.

Copy/paste and copy/paste special also copies across the hidden columns and rows so what I need to do is to copy it to a new workbook but then remove the hidden rows and columns and just delete the existing formulas in the cells which total the data and insert a new autosum.

View 3 Replies View Related

Remove Blank Rows From All Worksheets

Nov 29, 2006

I currently have dozens of sheets within a workbook and require empty lines to be removed from each page. I already have a working code to delete the lines but I now need to be able to apply this macro across all sheets in one go. I have included a sample excel sheet with the ‘delete blank rows’ macro and also the code I have been trying to use (without success) to apply the macro across all sheets. The apply macro to all sheets I’ve been trying to use is:

Sub AllSheets()
Dim ws As Worksheet
For Each ws In Worksheets

Next ws
End Sub

View 3 Replies View Related

Remove Rows Not Meeting Criteria

Nov 30, 2006

I am trying to delete rows - based on 1 field in each row not being equal to ANY of the values stored in an Array. e.g. my array has 3 values, CAT,DOG,MOUSE

cells are:
A1 = CAT
A2 = HORSE
A3 = DOG
A4 = DOG
A5 = BIRD

i want to delete rows not containing CAT,DOG,MOUSE. I think the autofilter could be the trick but cant quite get my head around it.

View 5 Replies View Related







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