I am using an autofilter to delete chunks on unwanted data, by using Range(Selection, Selection.End(xlUp)).Select however it picks up the header row. Is there anyway I can either get the selection of data to select one less line, or a way to get it to leave the header line?
I am using the following code to filter for data I do not want and then to delete those rows and show remaining data. It works fine except when the filter comes up empty and there is no unwanted data to delete.how to improve this code to accomodate this situation?
Selection.AutoFilter Field:=4, Criteria1:=">" & dweekend, Operator:=xlAnd Range("A2").Select Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select Selection.EntireRow.Delete ActiveSheet.ShowAllData Thank you for reading
I have a spreadsheet that i manually edit each and everyday e.g.
A B C EABGL/UD NDT254892 MRMR/RUS/ELQNS259762 LSL/UW/B LQNS267259 WWEX/UQ bbr263666 LWL/KL/B 270407 MYTCJ/UB NDT271774 LNL/SB/UB HLC - 271955 SMMQD/WT HLC - 269516 EACO/TN/UGBBR257827 NILVA/UC EUi273645
For everything that doesnt equal EM, LN, LW and TH in column A, everything should be deleted in column B.
For the remaining EM, LN, LW and TH, i would then like it to delete / (forward slash and all characters after this) so that this would make my life easier.
I am aware this is probably very simple, but I haven't been able to find a usable macro yet. I would like the data in the workbook that is not "Tuesday" (column L) and is not "3" or "4" (column I) to be deleted. All rows that have "Tuesday" and either "3" or "4" should not be deleted. Each row that is not deleted must have Tuesday in column L. All other cells are blank intentionally. The workbook will remain the same titled WKBK1 (no need to put the output data in a separate workbook nor separate spreadsheet).
Do you know what the macro would be so I don't have to copy and paste a formula over a large number of cells?
I'm using excel 2010. I'm working with columns of values where most of the values are numbers - which is fine, and there are some numbers that have a "p" at the start of them.
e.g. Column has 49, 52.2, p56.7, 34
OK, I want to preserve the 56.7 but I want to delete the "p". I'm thinking I've got a mental block as to how to delete the unwanted "p"s but I can't think of how to do it at the moment! My code goes as follows:
If Left(Cells(1,1),1) = "p" then 'delete the "p" and leave the remaining number in tact End if
I want to delete some unwanted rows on closing my excel file. the blank rows are between set of datas. so it has to check all the blank rows, delete it until the last one. example
data blank rows data blank rows data blank rows data
I have set of data Pasted in 4th row, in the top row 44 columns values assigned i want move data from set of data to different column among these 44 columns
Like "Service Order ID" is 1 column in set of data ,it move to second column of top row
Some of column need to delete. (Service Order Type,Service Order Description,Created By,Status,Contact,Expected Delivery Date,
My spreadsheet has 600rows and the vertical scroll bar ends at row 459424. I have attempted to delete all of the extra rows by holding SHIFT and CTRL, striking the down arrow then right-clicking on the left margin of highlighted row numbers and choosing delete.
But the unwanted rows are still there and my vertical scroll bar is not correlated to the 600 rows.
The problem sheet attached to this thread. I would like to extract all rows belonging to one person to another sheet named after the person and also their status. For instance, I want a VB script which extracts all rows with Mark when his status is A/V to another sheet named as Mark and likewise for Steve.
I have a calendar-template that contains entries - little text-chunks - and i also have a excel-sheet that contains 365 texts - those have to get imported into the Calendar-template. - see the attached files for more infos. Play around with the calendar-template.
Note: the attached data contain the following
a. the calendar-template (attachment a) b. the excel-sheet - with the 365 text-chunks that have to get imported into the template (attachment b)
What is aimed - i want to have a weekly calendar for my own usage
To see what we already have - take the calendar-template.
You see the calendar-template contains the fully-fledged view of the second week in 2014.
If you jump to the filed A 2 in the calendar-template (attachment a) - here you see the date - actually the 2014-01-06 You can play around and see that the greek verses are already included for the whole year. If you choose any date of the year - the greek verses in the template already are added.
What is missing - are the additional text-chunks that are represented in the excel sheet.(b)
note. i have colored the fields in the calendar-template and the excel sheet with corresponding colors so we can see - which fileds have to get filled with which text-chunks of the excel-sheet. Additionally the calendar-template contains the fully-fledged view of the second week in 2014.
Question. can we do a automated version?
Attached files: a. _calendar_2014_week_2_demo_excel_version - this is the calendar template b. _words_2014_365_days_excel_version - this is the additional text sheet that contains the 365 text chunks - slogans
Each week I import some data into my workbook (its financial-imports stock names, identiy codes and stock type). I've added a formula which calculates the credit ratings of each stock type, and then conditional formatting to highlight any credit ratings which are less than my required rating.
Further to this I need to get rid off all the rows which which have an stock type "No Asset Class". I cant use auto-filter because there are too many other stock types which I need to be included.
I am working in a worksheet with 15k rows of data. I have sorted and added subtotals. Is there a way to remove data based on number of occurrences? Example, if the same account number is listed less than times in the worksheet, i would like to eliminate the account number from the data. How can i achieve this?
I have a workbook that has ben imported into excel and I need to extract the Cabinet sizes (red text) from ColumnC On Sheet2 leaving out the rest of the info. I have a button on the home sheet that has the code that I am running to generate this report it will do most of what I want but I am stuck at extracting the cabinet sizes.
The data is coming from the SheetComponetListing worksheet and going to Sheet2. I have manually created the end result that I am looking for on the CabinetSize worksheet. [URL]....
From my data set I would like to delete all rows that show "Yes" in Column I.
I copied this piece of code a few days ago from this site and have attempted to modify it eg by altering Columns to "I" and Autofilter Field to 9 and Criteria1 to = "Yes", but without success. Can you please help?
With Columns("A") .AutoFilter Field:=1, Criteria1:="" .Range("A2:A" & Rows.Count).EntireRow.Delete .AutoFilter End With
I have a data sheet which I need to filter in some way with multiple criteria. For example
I have a sheet called Training which has 4000 rows of data. Column F is labelled Cost ID and under this column I have 400 different IDs of which I need to see data for 155 out of the 400.
Is there a simple way of removing the unwanted data?
I use Excel 2007 and need to find the best way to delete rows selected after Auto-filter. This autofilter selects multiple criteria for a particular column. The closest post to do what I am looking for is: [url]
But this doesn't really help me firstly because it pops out an input box and asks to enter 1 criteria. I have multiple criteria for each column depending on which I'd like to delete rows.
Alternately, I have been trying this code belwow but its too time consuming for my 50,000 rows.
Sub CodeCleanup() Dim r As Long r = 65536 For I = 1 To r If Cells(I, 30).Value = "R" Then Rows(I).Delete End If Next I End Sub
I have an excel sheet with approx 30,000 rows of data.
These are all keyword phrases.
They can be related to any subject, but for this example these are related to the root keyword phrase of "car Rent"
I have some software which basically pulls in keyword phrases from search engines and meta tags etc, including misspelled keyword phrases.
My problem;
The data is uncleaned.
In other words there might be I think it's called "Carriage return" data in there, so the row of data might be very deep (Instead of a row height of say 10.5 it could be anything, IE some could be 100 or 200 even).
There are unwanted characters, for example; ()[]{}+?!""^*
(If it could delete all unwanted characters except for letters/digits) There is a problem I see, that if it removes _ or - between words, that it will join the words together which won't be of any use. If it deletes anything with a letter either side of it or a letter and digit, or 2 digits, 1 either side it would then need to add a space to replace the hyphen.
So for example; if there was a phrase in the list like ....
I have a sheet for addresses (Column 1 = Name, Column 2 = Address line 1, Column 3 = City, Column 4 = Postcode) and I run a macro that Filters that data based on the the city to different Tabs. This works fine except that sometimes, once the data is filtered I will find one or two addresses on my new filtered sheets that I really wanted to exclude. As my main address Tab information changes regularly, Ideally, I would like to see the Item on the City filtersheet, Double click it, and this would have the effect of deleting it from the City filtersheet but also copying it to an "Exclusions" Sheet which I could use before I run my normal filter macro to filter out these bad addresses.
I have created a file where I use the Subtotal function. Once I collapse the information to only give me the Total, I would like to copy the Total rows into another worksheet. However, when I do this I get blank lines in between. I am trying to find a way to delete the blank rows in between the Total rows I need. Is there a way to do this with the auto filter function?
Wondering if there's a macro that can do this when i press a button.
In spreadsheet "Complete Backlog"Autofilter onShow rows where WIP Status (Column K) equals "Closed"Cut rowsPaste into next available row of "Closed Jobs" spreadsheet. No overwrites.
Or you could switch step 5 and 6 so that the rows are copied over to "Closed Jobs" and then deleted from "Complete Backlog".
I'm wondering if anyone has a answer to the problem of deleting all the rows that are hidden by an autofilter. We currently have a spreadsheet used within the office that catalogues all applications received, and we want to select all the applications that are relevant to a certain month with the autofilter and use a macro to delete those that are irrelevant, before emailing the spreadsheet to a client. Manually deleting all irrelevant rows would be time-consuming.
The current code I have is:
With Worksheets("Sheet1") If .AutoFilterMode Then With .AutoFilter.Filters(1) If .On Then Else: Rows.Delete End If End With Else: End If End With
The theory is that the code first selects the relevant worksheet, determines whether autofilters are on, selects data that is being covered by the autofilter, indentifies those that is being displayed and does nothing, and identifies those which are not displayed and deletes them - in theory!
My code inserts charts and then assigns them data series. The problem is that sometimes it likes to grab 5 or 6 extra sets of data series and throw them in there too. I've done some research and it seems that Excel likes to guess what data is going in to a chart when you first add it in and grab some of that, rather than just waiting for me to assign it the data. The sheet I'm doing this on has multiple sets of similar data along row 1, the code crawls row 1 and creates a new chart for each set of station data it finds.
Code: Sub Make_Chart() 'create bar chart 'prep Set chrt = ws.Shapes.AddChart.Chart
'add and format chart
[Code] ........
Example data set below. RefCell is set to the top left cell (4.02), n is the length of the raw data in rows.