A macro that will delete a tab or tabs in a file if and only if rows 11, 13, 23 & 25 are completely blank within that tab? So basically ALL rows would need to be blank, if there is any data within any of those rows, then tab should NOT be deleted.
I currently had to start from scratch as my formula kept raising the debug screen. I know the answer is simple but I cant figure out what it is. I have column A, rows 9 through 1000 with data. I want to delete the entire row of any "x" value present in column A rows 9 through 1000. I am new to VBA. So simple is good.
I went to the Macros page and pulled this macro to remove rows if they have blank cells:
Sub DeleteBlankRows2() 'Deletes the entire row within the selection if _ some of the cells WITHIN THE SELECTION contain no data. On Error Resume Next Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete On Error Goto 0 End Sub
I ran this and nothing happened. Does anyone have a fix or perhaps a better way to make this happen?
If I have a column of data called "ColStream" and want to delete all rows that don't contain the string "Production", whats the best way to achieve it?
I have tried a for each loop, with INSTR but as this moves down a cell from the cell whose row has just been deleted, skipping the "NEXT" row in the range, it doesn't give the correct results.
Incidentally, the end game is to copy all the remaining cells to the cell immediately below a cell called "StreamsDatabaseStart" in a worksheet called "ProdStreams" should anyone out there be feeling particularly charitable!
I am using Excel 2010 and basically i am trying to fill a range of cell with a green color if any value was enter in a specific cells. Example: I would like to fill range: A10:c13 with a green color (regardless of the cells content in this range) if a value was entered in cell C10 or C11 or C12 or C13.
I've tried conditional formatting but unfortunately I'll have to apply formatting for every cell and for a range of over hundred cells is not efficient.
I have several lists that I need to be able to print out periodically.
The main worksheet that underpins each list is over 900 lines long and numerous calcs and formulae populate columns to provide the data for my 'print lists'.
I need my 'print lists' on seperate worksheets and I have linked the data from my main worksheet results, using IF statements to stop unwanted results being displayed by making the rows appear empty (i.e. to display "").
Due to the design of my main Worksheet it is inevitable that I have many rows in each 'print list' that are not required for that particular 'print list'.
I want to remove the 'empty' rows from the print sheets at the time of printing. I cannot use the GoTo > Special > Blanks > Delete Rows because the rows are not recognised as being 'blank'.
I have attached 2 screenshots of my 'print lists'.
P.S. I am not assuming anything but I have searched on OZGRID and it appears to me that I might need to use Excel/VBA?
I would like a macro that deletes rows based on having two blank cells in adjacent columns. I have achieved this with the following code however i need it to only delete rows below a certain row. How would i achieve this?
Sub DeleteBlankARows() Dim r As Long For r = Cells(Rows.Count, 30).End(xlUp).Row To 1 Step -1 If Cells(r, 3) = "" And Cells(r, 4) = "" Then Rows(r).Delete Next r End Sub
Each week I run a report that produces over 2,000 rows. I have to manually go through and delete things, by the time I am done, there may only be 320 rows left. I would apply a recorded macro, but the report is not consistent each week. There may be more or fewer rows depending on the week.
I would like to be able to run a macro that looks in column B for a specific value and if it contains that specific value, I would like the cells to the right of it to have their contents cleared.
Next, in column C, I have...
Employee2's Name Employee2's Number SPACE
I would like to be able to delete the rows, starting from Employee 2 to just before the second SUB TOTAL.
Currently I am using the Kickbutt VBA Find Function of Aaron, but I would like to have something that works more efficiently. What I currently do is (assuming all possible values for Column J are A - F):
I have an imported report in a spreadsheet. It imports to three columns. I need to check each row in column A for three seperate criteria and delete the rows I don't need. I need to delete blank rows and check next row for page header info. Delete these and next rows to next blank cell. Check next row for page header and not delete if not page header. Several rows down will be a cell with 23 blank spaces before the word Reg: and sometimes other words past this but always this first. This row is to be kept. I looked at the FAQ's example of Deleting but I don't think it will work. I also need to put a key word in column A at a point where I want to stop. This report is a couple thousand rows long so a VBA procedure would really save time. I have a procedure I use to check for two zero's in two cells that hide these rows but I couldn't modify it to work on this report.
I have been trying to delete about 86k rows in my table in a worksheet. It has been over 5 hours now and it is still running to delete. any better solution? or how long do i need to wait for the system to finish its work?
I have a real problem with a file I'm working on. It has invoice numbers in one column, followed by payment milestones. In the row underneath, there is an 'x' to mark if payment was made in a particular zone, e.g.:
The current worksheet has data which is retrieved from other worksheets.
Current worksheet A1= Sheet1!A1 Current worksheet A10= Sheet2!A1 Current worksheet A20= Sheet13!A1
The range of this current worksheet is A1:F1287 and inbetween there are blank rows. The cells in the current worksheet are not technically blank, because each cell (A1:F1287) retrieves the information from the respective worksheet.
I would like to know of a VBA code to delete a whole blank row/-s (all columns of this row is blank) inbetween the range. Therefore, if there is a whole blank row, this row to be deleted and to go to the next row that shows information . In other words, instead of me manually searching and deleting whole empty rows; a VBA code for this task.
I am trying to write a macro that will check from 1 to 143 columns..and if all the columns are empty then it has to delete that entire line. Totals rows are over 35000. I am using excel 2007. I have written the below code. Could someone pl help me in enhancing this.. or a better way as this is taking about an hour to complete.
Sub Costa() Dim i As Long Dim j As Integer j = 2 For i = 2 To 37735 loop1: For j = j To 143 If Cells(i, j) = "" Then j = j + 1 GoTo loop1 Cells(i, j).EntireRow.Delete Else j = 2 GoTo loop3 End If Next j Cells(i, j).EntireRow.Delete loop3: Next i End Sub
I created the following macro to remove all rows that contain the value 'Shutdown" in column F
Sub DeleteUniqueValues() Dim LR As Long, i As Long LR = Range("F" & Rows.Count).End(xlUp).Row For i = LR To 3 Step -1 With Range("F" & i) If WorksheetFunction.CountIf(Columns("F"), .Value) = Shutdown Then .EntireRow.Delete End With Next i End Sub
The macro runs without error, but when I checked the spreadsheet, rows matching this criteria were not deleted.
is there a code to chose certain rows using there numbers (Row number 3 to row number 9) to be deleted? yes, there is a code to delete the selected rows, but what i am after is a code to chose rows by thier numbers like delete from row3 to row9?