LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Need Help Looping through a file

Hi,

I have tried to make some code that will search through a file and
move rows based on certain criteria to new spreadsheets. Code as
follows:

Sub life_file()

If Range("x1").Value Or Range("ae1").Value Or Range("ah1").Value 0
Then
ActiveCell.EntireRow.Copy
Sheets("LIFE").Select
ActiveSheet.Paste
Sheets("EOI_TEST").Select
ElseIf Range("aa1").Value Or Range("ac1").Value 0 Then
ActiveCell.EntireRow.Copy
Sheets("LTD_STD").Select
ActiveSheet.Paste
ElseIf Range("x1").Value And Range("ae1").Value And Range("ah1").Value
And _
Range("aa1").Value And Range("ac1").Value 0 Then
ActiveCell.EntireRow.Copy
Sheets("LIFE").Select
ActiveSheet.Paste
Sheets("LTD_STD").Select
ActiveSheet.Paste
End If


End Sub

The problem is that I can only make it look at the first row on my
file. There could be a varying number of rows on the file so i can't
just sent a specific range for the macro to look at. I'm not sure how
to make it loop through until all rows have been looked at. Can some
one help?

Thanks!
 
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
About my looping jonathan Excel Programming 3 July 31st 07 02:48 PM
Looping through folders and using the first file in each folder Conan Kelly Excel Programming 2 September 28th 06 04:23 AM
Looping Gusset Gadder Excel Programming 2 December 11th 04 09:16 PM
Looping René Excel Programming 6 May 28th 04 02:14 PM
Looping though *.xls files except for the main consolidation file Thomas[_14_] Excel Programming 5 April 28th 04 04:17 PM


All times are GMT +1. The time now is 03:11 PM.

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

About Us

"It's about Microsoft Excel"