|
-
Feb 9th, 2005, 10:40 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Premature loop ending
The following code is not working properly...it works for the first cell but then it quits even though there is value in the adjoining cell
Sub Downtime()
Range("G1").Select
For q = 0 To 500
ActiveCell.Value = ActiveCell.Offset(0, 1).Value - ActiveCell.Offset(0, 2).Value
ActiveCell.Offset(1, 0).Select
If ActiveCell.Offset(0, 1).Value = "" Then
Exit For
End If
Next
End Sub
-
Feb 10th, 2005, 01:38 AM
#2
Re: Premature loop ending
As I thought: You are checking Columns (to the right)
Returns a Range object that represents a range that’s offset from the specified range. Read-only.
expression.Offset(RowOffset, ColumnOffset)
expression Required. An expression that returns a Range object.
RowOffset Optional Variant. The number of rows (positive, negative, or 0 (zero)) by which the range is to be offset. Positive values are offset downward, and negative values are offset upward. The default value is 0.
ColumnOffset Optional Variant. The number of columns (positive, negative, or 0 (zero)) by which the range is to be offset. Positive values are offset to the right, and negative values are offset to the left. The default value is 0.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|