View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick[_19_] Rick[_19_] is offline
external usenet poster
 
Posts: 52
Default Help with Do Loop

How about a For Loop example instead?

Sub ForLoopExample()

Dim tw As Workbook
Dim S1 As Worksheet
Dim i As Integer

Set tw = ThisWorkbook
Set S1 = tw.Sheets("Sheet1")

For i = 8 To 300
If S1.Cells(i, "C").Value = "1/15/2004" And _
S1.Cells(i, "E").Value = "AVE US" Then
S1.Cells(i, "F").Formula = _
"=IF($D$8$D$4,$D$8-$D$4,0)"
End If
Next i

End Sub

You can substitute the numbers 3, 5, and 6 for "C", "E",
and "F", to get the same result.

-----Original Message-----
Hello guys and guru's

I need help in creating a macro. I am a newbie and

browsing the help
file but reallly I cant get it.

I need a macro that will put this formula =IF(D8$D$4,D8-

$D$4,0)
at F8 to F300

if it satisfy this condition that will look in column E8

to E300 is
equal to "AVE US" And column C8 to C300 is equal

to "1/15/2004"

Its giving me a headache coz it has too many condition

for a beginner.
If anybody can help please....


---
Message posted from http://www.ExcelForum.com/

.