View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Leo Heuser[_3_] Leo Heuser[_3_] is offline
external usenet poster
 
Posts: 109
Default Need help creating a case statement

You're welcome.

Will this one do the job?

For Each Cell In Range("D3:AJ19")
IF [D$1] = [$B3] And [D$1] <= [$C3] And _
[E24] = [AK1] And Cell.Offset(0, 33+OffsetVal) = 2 Then

For j = StartNum To StartNum+6
Cell.Offset(0, j).Value = Range(AK$1).Offset(0,OffsetVal).Value
Next j

StartNum = StartNum + 7
OffsetVal = OffsetVal + 1
End if
Next Cell


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"hotherps " skrev i en meddelelse
...
Thanks Leo,
The code is working somewhat, I'm not sure exactly what is missing
though. You were correct about the last cell it is supposed to be AK,
however the next time the loop runs on that same row, it should then
increment to AL, AM etc.

On the rows that the code runs on it starts at the proper location, but
for some reason when the same criteria is met it will not run. Can't
figure it out. I'm attaching it if you want to take a look.

Thanks again

Attachment filename: copy of hotherps7.xls
Download attachment:

http://www.excelforum.com/attachment.php?postid=559713
---
Message posted from http://www.ExcelForum.com/