Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Help: delete whole row if the cell does not contain string "*"
Hi all, I am only a beginner in VBA. I have come across the problem where I have a range of data in excel. In each rows, I want to check if the cell in that row does contain a string "*". If the row where the cell does not contain string "*" I want to delete the whole row. I am having problem in figure out how to relate each cell search if it contains a string"*". Can anyone give me some idea/help? Thanks ZenZen -- zenzen ------------------------------------------------------------------------ zenzen's Profile: http://www.excelforum.com/member.php...o&userid=30224 View this thread: http://www.excelforum.com/showthread...hreadid=499014 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Help: delete whole row if the cell does not contain string "*"
Pseudo-code:
Loop down the column of the cells you are checking, something like... Do {Check Deletion criteria} move one row down Loop until end criteria If the deletion criteria matches, move to the next row and then delete the previous. Checkcell.offset(-1,0).entirerow.delete HTH "zenzen" wrote in message ... Hi all, I am only a beginner in VBA. I have come across the problem where I have a range of data in excel. In each rows, I want to check if the cell in that row does contain a string "*". If the row where the cell does not contain string "*" I want to delete the whole row. I am having problem in figure out how to relate each cell search if it contains a string"*". Can anyone give me some idea/help? Thanks ZenZen -- zenzen ------------------------------------------------------------------------ zenzen's Profile: http://www.excelforum.com/member.php...o&userid=30224 View this thread: http://www.excelforum.com/showthread...hreadid=499014 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Help: delete whole row if the cell does not contain string "*"
when you need to delete a row, it's better to start at the last row and work
your way up. -- Gary "zenzen" wrote in message ... Hi all, I am only a beginner in VBA. I have come across the problem where I have a range of data in excel. In each rows, I want to check if the cell in that row does contain a string "*". If the row where the cell does not contain string "*" I want to delete the whole row. I am having problem in figure out how to relate each cell search if it contains a string"*". Can anyone give me some idea/help? Thanks ZenZen -- zenzen ------------------------------------------------------------------------ zenzen's Profile: http://www.excelforum.com/member.php...o&userid=30224 View this thread: http://www.excelforum.com/showthread...hreadid=499014 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Help: delete whole row if the cell does not contain string "*"
I have a few examples here
http://www.rondebruin.nl/delete.htm You can change the = for < to do what you want -- Regards Ron de Bruin http://www.rondebruin.nl "zenzen" wrote in message ... Hi all, I am only a beginner in VBA. I have come across the problem where I have a range of data in excel. In each rows, I want to check if the cell in that row does contain a string "*". If the row where the cell does not contain string "*" I want to delete the whole row. I am having problem in figure out how to relate each cell search if it contains a string"*". Can anyone give me some idea/help? Thanks ZenZen -- zenzen ------------------------------------------------------------------------ zenzen's Profile: http://www.excelforum.com/member.php...o&userid=30224 View this thread: http://www.excelforum.com/showthread...hreadid=499014 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Help: delete whole row if the cell does not contain string "*"
Thank you everyone! I now have some idea and will try it out -- zenzen ------------------------------------------------------------------------ zenzen's Profile: http://www.excelforum.com/member.php...o&userid=30224 View this thread: http://www.excelforum.com/showthread...hreadid=499014 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string | Excel Worksheet Functions | |||
Converting "uppercase" string data to "lower case" in CSV file | Excel Discussion (Misc queries) | |||
text string: "91E10" in csv file auto converts to: "9.10E+11" | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc | Excel Programming |