Macro To Delete Excess Data
Feb 10, 2009
I have a large dataset with 21 columns and 3000 rows, but to keep it simple, the data looks more or less like the first dataset in the attached excel file.
This results in 3 curves (time vs force). However, there is excess data in there, I only need data as soon as the Force becomes positive (>0) untill the Force drops below 0.02 again (I consider that the end-point of my curve). So, this dataset would look like the second set in the excel file after the macro-manipulation.
I think one of the difficulties is making sure that the macro doesn't cut of my data right in the beginning, when the curve first crosses 0.02. In that case, you get the last dataset. And this is not what I want...
I hope I explained my problem well, if not, please let me know.
So, is there anyone who knows how to do this?
By the way, is there anyway to insert small excel tables in this post? Cause I wasn't planning on having an attachment, but if I copy-paste the data in this post, than the formatting gets undone and it looks like there's no way to fix it...
View 6 Replies
ADVERTISEMENT
Apr 24, 2008
I've exported some data from our finance system into Excel and now need to pivot it, problem is that there are 100k plus rows and therefore goes across more than 1 worksheet. Had a read through the forum and a number of topics about this but I'm a bit stuck. I've got as far as
1. Ungroup the 2 sheets, copied the row headers from sheet 1 to sheet 2 and then named the data in each sheet. I therefore have 2 identically arranged data ranges (albeit one is 65k rows the other 40k rows) named 'block1' and 'block2'
2. In a new workbook I've done
Data > Import External Data > New Database Query
3. I followed the wizard and slected Block1 as the table
4. In MSQuery I've edited the SQL to read
SELECT * from block1 union all select * from block2
I'm now stuck and have 2 issues
1 I'm only showing 8192 records is this a limitaion of MSQuery or has something gone wrong ?
2. I still don't know how I pivot the data
View 9 Replies
View Related
Feb 17, 2014
I have obtained the following data which I need to put into a spreadsheet to import into an accounts program. I can't change the way I get the data which is as follow
Hrs worked Rate
05:55:00£30.00/Hour
07:40:00£21.00/Hour
05:45:00£30.00/Hour
What I need to have is 5.92 30.00
7.67 21.00
5.75 30.00 ie the time format in decimal and loose all the unnecessary symbols etc for the rate
View 7 Replies
View Related
Mar 30, 2009
I've got a spreadsheet that uses about 2200 rows and about 15 columns. However, when I try to insert a column, it freezes up the application. My assumption is that this is caused by the fact that there are in excess of 65,000 rows. When I try to highlight those 63,000 rows and delete them, the system freezes up as well.
These excess rows are unnecessary and I'm sure add to the file size.
Running Windows XP with Excel 2003.
View 9 Replies
View Related
Dec 8, 2007
i'm working with downloading data from our server. it downloads in excel 3.0 format, and the contents exceed the 65k cap by far.
now what i used to do for this when i had 2003 installed on my machine, i would open the 3.0 format file and convert it to 2003 format so i could import it into access, where i could move it into two 2003 xls files to manage by use of copy/paste from access's table to excel's spreadsheet. The 3.0 > 2003 conversion was necessary because if i try to import a 3.0 excel file into access 2003, it gives me a error that the file contains no data.
so here is my problem now. our office just updated to 2007. it appears that when you run the conversion option to 2007 format, OR just save as... and save it to a new xlsx, it stripps off the remaining data that overstacks the 3.0 format file. everything above row 65536 is lost (and this paticular file has 77k+ rows).
so i decided... "ok then i'll do it my old way". i saved it into 2003 format instead, just as i used to, and imported it into access, and guess what? it stripps it in that format too now! (the majesty of upgrades... buggs to year 2010).
so my question is... how do i get this 3.0 overstacked file format converted to xlsx format retaining ALL 77k rows in a single sheet, or how do i strip it into 2 separate xls 2003 format files? either way will work, i just need all my data so i can work with it.
View 9 Replies
View Related
Jan 14, 2009
I am trying to write a function that sums the values in a range in excess of 2. For example, if the cell is 3 add 1, if it is 5 add 3 etc.
Here is what i have so far, it compiles with no bugs, but it does not work in my worksheet. I wrote it in Sheet 1 (VBA) of the worksheet i am using it in.
View 2 Replies
View Related
Dec 7, 2012
I have got a cell or cells with certain number of Characters (Alphabetical or Numeric or Alphanumeric). I would like to remove the excess Characters in the Cell from the end.
Example: If a cell contains 234 characters, Excess characters (More than 200) to be removed from the end.
Any formula or Vba program in generic form, so that i can limit the number of Characters to as required.
View 3 Replies
View Related
Jan 31, 2008
I need VBA to remove more than 3 blank spaces after the city & replace them with a comma & one blank. For example:
All in one column AB starting with row 7 I have:
Johnson City (13 Blank Spaces) NC 75503 (1 to 3 spaces after state & is OK)
Jacksonville (10 blank spaces) Fl 23854
Henderson (12 blank spaces) NH 28363 (12 blank spaces)
etc
I need all in one column AC starting with row 7:
Johnson City, NC 75503 (,space before state, same space after state ok)
Jacksonville, FL 23854
Henderson, NH 28363
etc
View 9 Replies
View Related
Dec 16, 2008
I am working with Excel 2003. I have a series of spreadsheets generated by my companies database program. For a special project I am trying to work on, I would be able to get my results much much quicker if I could get a macro that would do the following:
The first row is a list of headers. I need the macro to look at each cell below the header, and if any data exists in that column, I need it to delete the entire column. The results I will get will tell me quickly which headers are in certain jobs but are constantly not being used. They are trimming the database at work and this type of macro would help me tremendously.
View 12 Replies
View Related
Nov 18, 2005
In the sample below I need a macro that will delete the entire rows
where the data is repeated in a given column---that is, that it would delete
the repeat ones, leaving one of them. In this example, in the first set, all
that should be left are two rows which contain ME22N and MR8M in column E.
ME22N is repeated two more times and those rows need to be deleted.
If I could get a macro that would ask for the column to operate in, that would be
great for other spreadsheets where it would not necessarily be column E.
ABC DE
MACLEOLLynn MacLeodP0040104ME22N
MACLEOLLynn MacLeodP0040104ME22N
MACLEOLLynn MacLeodP0040104ME22N
MACLEOLLynn MacLeodP0040104MR8M
MACLEOLLynn MacLeodP0050006MB0A
MACLEOLLynn MacLeodP0050006MB0A
MACLEOLLynn MacLeodP0050006MB0A
MACLEOLLynn MacLeodP0050006ME21N
MACLEOLLynn MacLeodP0050006ME21N
MACLEOLLynn MacLeodP0050006ME21N.............
View 12 Replies
View Related
May 6, 2003
I need a macro to delete rows that contain specific data in column A. For example, in the attached spreadsheet below,I need the macro to look for data in rows A1 - A7 (highlighted in yellow) and then delete the rows. The same data occurrs several times in the spreadsheet. The macro will need to delete all rows where this data occurs in column A.
Microsoft Excel - Book2___Running: xl2002 XP :
OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutD9=
ABCDEFGHI1
[Code] .......
View 9 Replies
View Related
Mar 31, 2008
I am looking for a macro to do the following:
Once data is copied to a tab labeled "data", it will sort on column H and delete all rows of data that do not have a AI or an RI code on it. Is this difficult to do?
View 9 Replies
View Related
Oct 27, 2008
I have an Excel Workbook with a Paid sheet and an Outstanding sheet both sheets have a File Number column.
I would like to create a macro that looks through the Outstanding sheet and if the File Number from the Outstanding sheet is also in the Paid sheet can the entire row be deleted from the Outstanding sheet.
View 9 Replies
View Related
Jan 20, 2010
i am in need of a macro to delete the rows with data only which then leave the sheets cleared and ready to use the next day. if i create a macro to clear say fifty rows of data and then tomorrow there could be 75 rows of data and the macro will fail clearing the sheet. if there is a solution can i just say i can create macros but never stepped into them in visual basic to change them, i guess your thinking what do i do if the macro doesn't work. and the answer is indeed yes i delete it and start it from the begining again and again till i get it right.
View 9 Replies
View Related
Jan 15, 2007
after importing data (data >> get external data >> import text file) and running a macro that contains
Cells(i, 5).EntireRow.Delete Shift:=xlShiftUp
i cannot insert any data into the next column below. why is this so? is it because of the excel memory that remembers that a macro has been previously ran in that cell before? example i import text file into B1 then the data will be imported into different cells using delimiters. the data will occupy from row 1 to 22. After i run the macro which combines fields with similar data the data will occupy row 1 to 15. then when i try to import data into B16. the "import text file" option will be grayed out. why is this so? how do i solve the problem?
View 4 Replies
View Related
Nov 18, 2009
I receive spreadsheets each month in the same format. It is effectively 6 rows of titles, 7 rows of weekly data, 2 rows of weekly summary, 3 blank rows then it repeats itself with the 6 rows of titles etc... down the page for 8 or so weeks.
I wish to create a (looped) macro that will leave the top set of titles and the 7 rows of weekly data (Mon to Sun) then delete the next 11 rows and so on and so forth to the end. I will then be left with the intro to the dataset followed by a whole months worth of data in continuous format as opposed to weekly summarised sections. But I am stuck as my macro knowledge is basic and I can only record macro's not program VBA.
I can create a macro and manually delete all entries for one spreadsheet but would rather have a code to do this than can run (x) amount of times in case the size of data changes. When it deletes section by section, the cells move up and the row numbers change.
View 3 Replies
View Related
Mar 31, 2009
I am trying to write a macro to delete all connections from a very large excel file
I created this file by using a Macro to extract data from a external data source (url's listed on a sheet)
The issue is the 1000+ connections on this file make it next to impossible to operate
I cannot recreate the file
macro to delete all connections in all sheets in a given work book.
[URL]
Macro used :
Sub Dump()
Dim myURL
Sheets("Sheet1").Select
ActiveCell.Offset(1, 0).Select
myURL = Worksheets("Sheet1").Range(ActiveCell.Address).Text
Sheets("Sheet2").Select
Range("A65536").Select
[code].....
View 3 Replies
View Related
Dec 6, 2006
I have one source spreadsheet, where are columns NAME, DATE. I read these data by ADO to other spreadsheet, where I can change/delete data and then run macro for update data in source spreadsheet. The problem: In source spreadsheet is column "NAME" and column "DATE", with values e.g. "Joseph"; 1.1.1980. I read this data to other spreadsheet, then I delete in it value 1.1.1980. When I run macro Update, it messages error.
Sub UpdateItem
...
.Fields.Item(1).value = activecell 'activecell value = "Joseph"
If Not isempty(activecell.offset(0,1)) Then
.Fields.Item(2).value = activecell.offset(0,1).value
Else
.Fields.Item(2).value = "" 'I tried Empty and 0 too but when I read data again then, it displays 0.1.1900, nothing works
End If
...
End Sub
It seems that in source spreadsheet has data in column "Date" format Date and when I try to update data in format String ("") in source spreadsheet by Update macro, it messages error. When I used
.Fields.Item(2).Value = Empty
' or
.Fields.Item(2).Value = 0
after rereading data it displays 0.1.1900 What I want to get is that if the cell with date (in other spreadsheet) is empty, the cell in column Date in source spreadsheet after updating will be blank (contains no values).
View 2 Replies
View Related
Aug 20, 2013
I need a Macro that will search all of the cells for specific text, and delete all cells containing the text. I prefer to make a list of the specific texts and run macro to find all of them and delete all cells containing the text. I need to be able to add some more text into the list in future.
View 9 Replies
View Related
Jan 10, 2012
What i have is a workbook that can have multiple sheets. Sheet 2,3,4 (if there are) are a continuation of sheet 1. First 2 rows of sheet 1 are headers and the last row of the last sheet (can be 2,3, 4....) is a footer. There are 14 columns (A-N) in each sheet. Col "N" has set status and col I has set names.
What i am looking for is a macro that can perform the following actions in the the set order:
1) deletes all rows where status in col N is "closed"
2) delete all rows where name in Col I is "Many"
3) if there are multiple sheets copy all data in 1 sheet once above 2 are deleted
4) I want to update cell A2, C2, I2, M2 & N2 with Hostel, Direction,Name,Flight & Status respectively
5) Create a pivot table with all data (Col A-N & Row 2 to last) in a new sheet and call it Summary - Pivot
I can then manually select how the pivot will look
Currently i am going through all sheets manually and filtering data. Using excel 2007
View 9 Replies
View Related
Jul 25, 2008
I am working with a spreadsheet generated from software that keeps track of fuel usage for a large fleet of vehicles. The data comes out looking like the snapshot below.
******** ******************** ************************************************************************>Microsoft Excel - June Fuel Transaction Listing.xls___Running: 11.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA3=ABCDEFGH3 Transactions for CUSTOMER ID: 0000CUST7 Sales 4 5 6Product summary for Vehicle ID 00001080 7 8Product Description Transactions Quantity9 101 Unleaded 3 57.60 GL11 12Hose summary for Vehicle ID 00001080 13Site ID HoseGradeProductTransactions Quantity140001 2113 57.60 GLJune Fuel Transaction Listing [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name boxPLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
I am trying to get the data into a more convenient format for analysis. I need a macro that will:
1) Take the text "Product summary for vehicle ID 0000****", extract the last 4 digits of the text, and paste it where the 1 is under the Product heading (a10). Those digits are the actual fleet number, and I need to separate them out from the rest of the text. The digits will change for each vehicle, so the macro should just move down the spreadsheet doing the same thing for each instance (the setup you see is repeated for every vehicle).
2) Once the first goal is accomplished, I would like the macro to then go back through and delete every row except for the rows with the pertinent data in them. So this means I would only want one row per vehicle and all rows would line up directly below each other like demonstrated below.
******** ******************** ************************************************************************>Microsoft Excel - June Fuel Transaction Listing.xls___Running: 11.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA10=ABCDEFGH101080 Unleaded 3 57.60 GL111081 Unleaded 6 84.70 GL121122 Unleaded 5 47.00 GL131182 Unleaded 8 95.80 GLJune Fuel Transaction Listing [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name boxPLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
View 9 Replies
View Related
Dec 20, 2008
I have a spreadsheet that allows room for 35 students per period, but instead of having the teacher manually go in and delete the extra data and hide the rows, I want to create a macro that will do so.
In cell B4 the teacher will enter how many students are in their first period class. (cell C4 for second period, cell D4 for third etc...) I want the entering of the number to automatically hide the superfluous rows and delete the data in the second column for those rows. I don't want the rows to be completely deleted because another year they may have more students and need those rows back.
I have attached one of the workbooks that I need to put this macro into. I have created room for 35 students in a given period. So if they have 23 students entered into B4 (period one) I would need rows 30-41 to be hidden, and I would need the formulas in B30:B41, E30:E41, H30:H31, K30:K31 etc....deleted.
Basically the point of the formulas is the teacher will enter the total points possible on that given assignment in cell B6, E6, H6 etc....and it autofills that score down, so the teacher only enters those that missed points instead of entering in the missed ones and the 100 percent ones.
I would need those formulas to be deleted because if the assignment was out of 10 then cell B30-B41 will give students a 10, and then the class average will be computing those scores,but those students don't exist.
But if I can't get the macro to auto delete the formulas, I will just not have those formulas in there, and the teacher can enter all scores.
View 9 Replies
View Related
Nov 7, 2012
I would like to delete a column using data validation list. for example :
i have a data validation INPUT list in cell A1 (Part No., Supplier 1, Supplier 2, Supplier 3) the heading start from B2,C2,D2,E2,F2. If user select Supplier 1 from data validation list in cell A1, the column Supplier 1 [c2] should be deleted.
And/or also if in cell B1 have a data validation INPUT row list (Part no.) & if user select part no.,
the selected part no. row should be deleted.
View 1 Replies
View Related
Nov 25, 2013
I am using Excel 2007 and have a simple enough macro to paste data in to another sheet - simple is what I do best.
Sub Macro1()
'
' Macro1 Macro
With Sheets("data")
.Range("B3").PasteSpecial xlPasteAll
End With
End Sub
I am wanting to change this so that before it pastes any data into B3 it will delete all data from B3:AE22.
I have had a look around and found plenty to delete full rows or worksheets but not just to delete the data in those cells.
View 8 Replies
View Related
Jul 30, 2013
I'm pasting a lot of data into a spreadsheet and then using a macro to split the data into three different sheets/tabs. I'm doing this by simply copying entire columns. Each sheet/tab has a headings row and autofilters added so that my boss can filter on certain manufacturers in one of the columns.
The problem is that when he selects a manufacturer, at the bottom left corner of the screen it shows the number of records, which at the moment will be something like "6 of 65211".
The actual sheet only has a few hundred rows (not 65211). So how do I delete all the blank rows beneath my data using a macro or vba code?
As an extra point, I'd like to use column B to check for blank rows (not column A).
View 6 Replies
View Related
Apr 24, 2014
I'm trying to create a macro that will look at each worksheet in a workbook and then delete the last line of data on each worksheet. The last row can vary on each worksheet. This is what I have come up with but it is not working. I am on Excel 2010 and Windows 7.
Sub Macro1()
Macro1 Macro
Dim ws As Worksheet
[Code]....
View 2 Replies
View Related
Jun 19, 2009
I want to delete a sheet in a macro but when I run the macro, I always get a message warning and I have to answer the msg box to delete the page. Below is the macro command I am using.
Sheets("Tel").Select
ActiveWindow.SelectedSheets.Delete
View 4 Replies
View Related
Oct 1, 2009
I'm looking to combine a number of worksheets into a summary sheet .. but on some the narrative is more than the 255 characters. How can I , where this is the case, insert a row below.. say input "Continued" in column A and then copy the contents of the cell which is more than 255 to the cell immediately below it.. and maybe do this again where users input more than 510 characters.
Alternatively, is there a way of getting around the copy and paste values.. where it only inputs 255 ?
View 9 Replies
View Related
Feb 7, 2008
I have recently grabbed the very helpful "Macro to delete VBA code" from this site, and it's working but with one small problem.
My worksheet runs a lot of code, then deletes all macro code and saves itself.
The problem is the next time i open I still get the macro security warning!
I've checked thoroughly and there is definatley no vba left anywhere.
If I open the document, enable macros, and save it, then open it again, I no longer get the warning.
View 9 Replies
View Related
Sep 18, 2009
I have two sheets, a data sheet with all our customers by ref, name and spend; and a presentation sheet.
In the presentation sheet I want to display the ref, name and spend of the Top 50 customers by spend, price high to low.
The workaround:
Copy all data from data sheet, sequence top down by spend, manually delete all after 50.
My only issue is that each month the data sheet will update and I want the Top 50 to auto update, without performing the workaround above.
Is there a way to do this without VBA i.e. pivot tables etc
View 10 Replies
View Related