Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
looping through rows and columns mattguerilla Excel Discussion (Misc queries) 1 March 20th 07 05:14 PM
Looping a selection of rows Andre Kruger Excel Discussion (Misc queries) 1 December 15th 05 04:18 PM
Looping through visible rows only Rasmus[_3_] Excel Programming 1 April 10th 05 02:08 AM
Looping through Ranges of Rows MS News Excel Programming 6 December 9th 03 06:13 AM
Looping through Ranges of Rows MS News Excel Programming 0 December 8th 03 11:42 AM


All times are GMT +1. The time now is 07:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"