Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Looper Blooper

Hi Stendahl,

Try:

If Rng1 Is Nothing Then
MsgBox ("Datum (date) kan ej hittas!")
Else
i = 0
Do Until IsEmpty(Rng1.Offset(i + 1, 0)) = True
If Rng1.Offset(i + 1, 0).Text = startDatumArr(1) Then
strTeststartDatumAddress = _
Rng1.Offset(i + 1, 0).Address
i = i + 1
Else
i = i + 1
If Rng1.Offset(i + 1, 0).Text = slutDatumArr(1) Then
strTestslutDatumAddress = _
Rng1.Offset(i + 1, 0).Address
Else
End If
End If
Loop
End If


---
Regards,
Norman



"stendahl_jones" wrote in message
...
I had a loop that worked just fine. Then I added an extra IF-Else and the
computer started complianing that I had loop without do, which is untrue.
Can
anyone see whats wrong with this loop?

If rng1 Is Nothing Then
MsgBox ("Datum (date) kan ej hittas!")
Else
i = 0
Do Until IsEmpty(rng1.Offset(i + 1, 0)) = True
If rng1.Offset(i + 1, 0).Text = startDatumArr(1) Then
strTeststartDatumAddress = rng1.Offset(i + 1, 0).Address
i = i + 1
Else
i = i + 1
If rng1.Offset(i + 1, 0).Text = slutDatumArr(1) Then
strTestslutDatumAddress = rng1.Offset(i + 1, 0).Address
Else: End If
Loop
End If

Thank you for your time.



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



All times are GMT +1. The time now is 04:39 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"