Macro Delete Page (delete A Sheet In A Macro But When I Run The Macro)
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.
I have a macro that I found on the net for copying a filtered selection and copying to a new sheet. I would like to alter it slightly so that it just clears the sheet called 'Interval tasks' instead of deleting it and creating a new one.
I have been able to put together a pretty hefty MACRO. I found out that some of the files I am importing may result in no data due to the manipulations I am doing. This causes a problem when I try to subtotal the data on each sheet. Is there a way to have the MACRO delete a sheet if cell a2 is blank and then continuw with the rest of the MACRO?
It asks me every time if I am sure and I have to click to continue. Is there any way to remove this prompt or set it to continue without my intervention?
I have one sheet that have +/-5000 data in 4 table ... all table is fill with just only 2 column, first column is Code Number and second column is Quantity.
There are many duplicates of different entries in Column 1st in all table range and I need to add up their quantities to new table in new sheet...
This is for example:
(Sheet1 name="INPUT") (table1=A:B) (table2=E:F) (table3=I:J) A B E F I J AB123 100 ABC123 20 AA1 10 AC278 50 BCD547 30 AA2 10 AB123 30 FGE988 30 AB3 10 DE586 120 ABC123 50 AA2 10 RE158 80 BCD547 120 AA1 10 DE586 50 ABC123 70 AD4 10
Then I want to use macro vba to create new sheet(Summary Report),copy,paste,sort and sum all duplicate...
It should look like this
(Sheet1 name="Summary_Report") A B E F I J AB123 130 ABC123 140 AA1 20 AC278 50 BCD547 150 AA2 20 DE586 170 FGE988 30 AB3 10 RE158 80 AD4 10
I am trying to adapt a macro which deletes all rows in Worksheet 1 where the date in column K differs from a date in Worksheet 2. The date in Worksheet 2 will change each day.
I think the macro below could be used, but don't understand how to replace the "Value = ":70:" with a reference to the master date in Worksheet 2.
Sub test() Dim lr As Long, i As Long lr = Range("A1").End(xlDown).Row For i = lr To 1 Step -1 If Cells(lr, 1).Value = ":70:" Then Cells(lr, 1).EntireRow.Delete End If lr = lr - 1 Next i End Sub
I want to delete a row if it contains componenten.
In here i ask to delete componenten not.
Or should i take "*componenten*" or totaly someting else
For MY_ROWS = Range("c65536").End(xlUp).Row To 1 Step -1 If UCase(Range("c" & MY_ROWS).Value) = "COMPONENTEN" Then Rows(MY_ROWS).Delete End If Next MY_ROWS
I have a macro that I would like to remove itself from the file as its last action. I don't want a warning message re file containing macros to show on opening the file.
I experimented with a simple macro in a worksheet template, but decided not to keep it and deleted the macro. However whenever I add the template to the workbook, it still asks about the macro and whether or not I want to enable it. When I go back to tools/macro to delete it, there is NO macro that shows up in the dialog box. Why is the workbook still asking me to enable a macro I deleted?
If fileSaveName False Then ActiveWorkbook.SaveAs Filename:=fileSaveName End If End Sub Now after saving this book. i work in it. After all work compted the book will be saved in safe place. I want to use a macro to delete that macro (1). So when I re-open it after few days, it should not have macro (1).
I have tried to record this but I cannot get it to work? On the tab “Add & Delete” cell “L17” I have a drop down list that is a list of the policy numbers from the “Data” tab.
What I am trying to do is assign a macro that searches column “J” on the “Data” tab based on the “L17” content on the Tab “Add & Delete” when it finds the data it then clears the contents of that entire row.
I'm using following code to delete some image called "Dev_Graph"
Sub Del_Graph() ' ' Del_Graph Macro Sheets("Report").Unprotect Password:="1234" ActiveSheet.Shapes.Range(Array("Dev_Graph")).Select Selection.Delete Range("B11").Select Sheets("Report").Protect Password:="1234" End Sub
the problem is, If i run this macro when there is no Image, i got a error msg.
I have a large file of data and the data looks like this repetitively, however, there are also useless data. But I figure out that the repeat data looks the same compare to the useless data. I need to extract the data that I only need. Is there a way to set a macro to search for a String from the beginning of the excel file, when the string is found, it will keep the 2 rows above and 56 row below it, then loop.
Here is an example of it:
A1 USELESS DATA A2 USELESS DATA A3 USELESS DATA A4 USELESS DATA A5 GOOD DATA
[Code] ....
The macro will start from A1 then go down till find STRING, then will keep 2 row above it which is A5+56 row below it which is A63.
Then continue at A64, then find STRING at A66 and do the same which is copy A64 (2 row above)+till A122 (which is 56 row below), then continue.
Since A123 to A155 does have any STRING, they will all be deleted..
I have a huge spreadsheet that I want to be able to sort through and delete the unwanted rows. I want to do a search for anything in column C that equals 2225 including the next row after and delete the rest. Here is an example...
Can't quite figure out how to do this. I'm looking to create a macro that will delete every other row of a filtered set of data. for example, if these are the filtered rows:
Attached is a sample data set. If all the positive and matching negative entries are located and removed, there are 4 remaining entries. The only pertinent columns are A through J, the columns after that are where my fiddling is occurring.
First you have to highlight all the data (including the control columns to the right). Then, my macro sorts the data by the absolute value (found in column O), allowing the formulas in N to then properly mark all negative entries with an "X and all the ones that now have a matching positive entry directly below it with an "X".
Then my macro hides all the fields with an "X" in column N. There is a macro called "CLEANSE" that does this, but only hides the rows. I keep messing up when I try to delete them entirely.
Can someone correct my macro so it will properly delete the rows with an "X" in the N column, or suggest a better macro that will scan the E column and flag matching positive/negative numbers and delete them without my control columns N and O?