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: 89
Default Anouther loop question

WOW - those last answers not only worked well but were som mcuh faster that
my code - I LOVE this forum!!!

Below is anouther loop I am using - it works but is slow and inefficient -
any suggestions for improvement would be muxh appreciated. Not sure how to
impliment the 'used range' and 'no selection' tips here.

Sub ProcessCountHistory()
Dim i As Integer

For i = 7 To 7500
Cells(i, 15).Select
If ActiveCell.Value = "" Then
If ActiveCell.Offset(-1, 0).Value = "YES" Then
If ActiveCell.Offset(-2, 0).Value = "YES" Then
If ActiveCell.Offset(-3, 0).Value = "YES" Then
ActiveCell.Offset(0, -2).Value = "Count required?"
ActiveCell.Value = "NO"
Else
ActiveCell.Offset(0, -2).Value = "Count required?"
ActiveCell.Value = "YES"
End If
Else
ActiveCell.Offset(0, -2).Value = "Count required?"
ActiveCell.Value = "YES"
End If
Else
ActiveCell.Offset(0, -2).Value = "Count required?"
ActiveCell.Value = "YES"
End If
End If
Next i
Range("a1").Select
End Sub
 
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
loop question in VBA h2o[_3_] Excel Programming 1 February 1st 06 08:33 PM
The 7 nested If() function Limitation. Is there anouther way? DMB Excel Worksheet Functions 9 January 15th 06 12:06 AM
end with loop question Lee Hunter Excel Programming 2 November 3rd 05 08:14 PM
copying the function contained within a cell to anouther cell. DMB Excel Worksheet Functions 2 September 1st 05 05:49 PM
In excel, importing from anouther sheet background colors will no. importing backgrounds Excel Worksheet Functions 0 April 20th 05 09:38 PM


All times are GMT +1. The time now is 08:37 AM.

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"