View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default if structure help

Do you mean

WithWorksheets("Sheet3")
For i = 2 to 5000
If .Cells(i,"A").Value = .Cells(i,"B").Value Then
.Cells(i,"C").Value = ""
Else
.Cells(i,"C"). = Format(Date,"dd mmm yyyy")
End If
Next i
End WIth

--

HTH

RP
(remove nothere from the email address if mailing direct)


"filo666" wrote in message
...
I have a sheet with 5,000 cells (a2:a5000) with numbers, and 5,000
cells(b2:b5000) with numbers, what I want to do is if a2 = b2 print "" and

if
they are different (else) print the Date, as I cant print 5000 times the
folowing formula in VB:
If Worksheets("Sheet3").[A11] = Worksheets("Sheet3").[b11] Then
Worksheets("Sheet3").[c11] = "" Else Worksheets("Sheet3").[c11] = Date


I need an other way to do what I want, Do you have any idea????

regards