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: 57
Default Every other

In the code below, I'm trying to write a row of 5 items to a new spreadsheet.
I have a feeling that I might be making this a bit more difficult than I
have to. But what's happening is that the sub only writes every other item to
the worksheet "Events" Why is it skipping items 2 and 4?

Sub event_write(w, r_ind)

With Worksheets("props 2")
Set t_range = .Range(w.Offset(0, -4), w.Offset)
End With
ind = 1
For Each t In t_range
If ind = 1 Or ind = 4 Then
Worksheets("Events").Cells(r_ind, ind).Value =
Format(t.Offset(0, ind - 1).Value, "hh:mm:ss")
Else
Worksheets("Events").Cells(r_ind, ind).Value = t.Offset(0, ind -
1).Value
End If
MsgBox t.Value
ind = ind + 1
Next t
End Sub

David
 
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 12:58 PM.

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

About Us

"It's about Microsoft Excel"