Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Not looping through rows
I have this function that makes 2 logical tests before it deletes that value in that cell... It searchs through a particular column in all rows that contain data for any value that is not numeric and that is also not of length 3 and deletes it. My problem is that it does not seem to be looping, it goes until it finds the next instance of my condition and then deletes but it does not look again unless I run the macro again, any ideas. -- bg18461 ------------------------------------------------------------------------ bg18461's Profile: http://www.excelforum.com/member.php...fo&userid=8877 View this thread: http://www.excelforum.com/showthread...hreadid=568312 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Not looping through rows
Give us the code.
"bg18461" schreef in bericht ... I have this function that makes 2 logical tests before it deletes that value in that cell... It searchs through a particular column in all rows that contain data for any value that is not numeric and that is also not of length 3 and deletes it. My problem is that it does not seem to be looping, it goes until it finds the next instance of my condition and then deletes but it does not look again unless I run the macro again, any ideas. -- bg18461 ------------------------------------------------------------------------ bg18461's Profile: http://www.excelforum.com/member.php...fo&userid=8877 View this thread: http://www.excelforum.com/showthread...hreadid=568312 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Not looping through rows
Maybe it's the way you're looping through the rows.
I've found it much simpler to start at the bottom and work up when deleting rows. dim iRow as long dim FirstRow as long dim LastRow as long with activesheet firstrow = 2 lastrow = .cells(.rows.count,"A").end(xlup).row for irow = lastrow to firstrow step -1 'do your checks and deletions next irow end with bg18461 wrote: I have this function that makes 2 logical tests before it deletes that value in that cell... It searchs through a particular column in all rows that contain data for any value that is not numeric and that is also not of length 3 and deletes it. My problem is that it does not seem to be looping, it goes until it finds the next instance of my condition and then deletes but it does not look again unless I run the macro again, any ideas. -- bg18461 ------------------------------------------------------------------------ bg18461's Profile: http://www.excelforum.com/member.php...fo&userid=8877 View this thread: http://www.excelforum.com/showthread...hreadid=568312 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
looping through rows and columns | Excel Discussion (Misc queries) | |||
Looping a selection of rows | Excel Discussion (Misc queries) | |||
Looping through visible rows only | Excel Programming | |||
Looping through Ranges of Rows | Excel Programming | |||
Looping through Ranges of Rows | Excel Programming |