Thread: looping?
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
nancy/karen nancy/karen is offline
external usenet poster
 
Posts: 9
Default looping?

Hello!

I have a production worksheet that information is entered into it on a daily
basis. The information is gathered but used in two seperate worksheets. I
have a macro set up for all of the general production totals in one of the
seperate sheets. I want to take specific customer data from the entered info
and place in the other worksheet without having to sort production cards or
cut and paste.

I came up with the following macro unfortunately, as it is it only gathers
the information from the first row of the worksheet. I cannot figure out
what I am doing incorrectly that it won't go to the next row? Please help my
eyes are crossed and my brain is unwilling to take another day of the pain!

Sub Button12_Click()
Dim d1 As Variant
Dim h1 As Variant
Dim m1 As Variant
Dim i As Integer, c As Integer, k As Integer
c = 28
k = 0
i = 3
d1 = Sheets("daily production").Cells(i, c)
d1 = Sheets("daily production").Cells(i, c).Value
If d1 < 0 Then
Sheets("daily production").Range("an1.ax1") = Sheets("daily
production").Range("ab3.al3").Value
If d1 = 0 Then

For i = 3 To 25
Next i
i = i + 1

d1 = Sheets("daily production").Cells(i + 1, c).Value

h1 = Sheets("daily production").Range("ab3.al3").Value
h1 = Sheets("daily production").Cells(c, 3).Value
h1 = Sheets("daily production").Cells(c, i + 1).Value

m1 = Sheets("daily production").Range("an1.ax1").Value
m1 = Sheets("daily production").Cells(c + 10, k + 1).Value

If m1 < "" Then
k = k + 1

Do Until i = 25
Loop

End If
End If
End If
End Sub



--
N/K