If Then statement comparing date values

L

ll

Hi,
I'm working on an If Then statement that compares date values. I've
currently got the following, but it isn't working. Thanks for any
help you might provide. - Louis
-------------------------------------
fillamt = UserForm1.TextBox6.Value
For j = 2 To fillamt

Cells(j, 1).Value = Cells(j - 1, 1).Value + 1
Cells(j, 1).NumberFormat = "m/d/yyyy"

Cells(j, 2).Value = Cells(j - 1, 2).Value + 1
Cells(j, 2).NumberFormat = "ddd"

If Cells(j, 2) = "Sat" Then
Cells(j, 4).Select
ActiveCell = "0"
End If

Next j
 
G

Guest

Sub ABC()
Dim fillamt as Long, r as Range
'fillamt = "13"
fillamt = UserForm1.TextBox6.Value
Set r = Range("A1").Resize(fillamt , 1)
Range("A1").AutoFill r
r.Copy r.Offset(0, 1)
r.NumberFormat = "m/d/yyyy"
r.Offset(0, 1).NumberFormat = "ddd"
For Each cell In r
If Weekday(cell, vbSunday) = 7 Then
cell.Offset(0, 3).Value = 0
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top