Sub moveit()
starthour = InputBox("Give starting hour")
starthour = starthour / 24
endhour = InputBox("Give ending hour")
endhour = endhour / 24
j = 1
With Worksheets("Sheet1")
For Each mycell In .Range("A1:A100")
If mycell >= starthour And mycell <= endhour Then
Worksheets("Sheet2").Cells(j, "A") = mycell
Worksheets("Sheet2").Cells(j, "B") = mycell.Offset(columnOffset:=1)
j = j + 1
End If
Next
End With
End Sub
You will need to format column A of Sheet2 to display time
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email
"Bruce S" <Bruce
(E-Mail Removed)> wrote in message
news:8124A754-447F-4849-BAE7-(E-Mail Removed)...
> I'm looking for a formula or macro that will allow me to copy rows to an
> existing sheet based upon a time range in one column.
>
> For example
>
> Sheet 1 would have two columns (A,B)
> ColumnA has times listed in military time (1:00, 13:00, 17:00)
> ColumnB has text associated with the time
>
> If Column A is within a specific time range, copy the row(s) to Sheet2