Hi
I have the following code in a macro. What it do is simple. In one column(H) i enter a time manually and in column(I) i have the current time. If H is bigger then I then do nothing if H is smaller than I bring up message box. This all work well but now i need to do it with more than 1000 line and to copy and paste is going to take allot of time that i do have but it will slow the workbook allot. is there a way i can use an array with the line number in the sheet1.range("H*") and sheet1.range("I*") and sheet1.range("J*"), * being the line number.
I have the following code in a macro. What it do is simple. In one column(H) i enter a time manually and in column(I) i have the current time. If H is bigger then I then do nothing if H is smaller than I bring up message box. This all work well but now i need to do it with more than 1000 line and to copy and paste is going to take allot of time that i do have but it will slow the workbook allot. is there a way i can use an array with the line number in the sheet1.range("H*") and sheet1.range("I*") and sheet1.range("J*"), * being the line number.
Code:
Sub Macro1()
Dim MustTime As Integer
Dim CurTime As Integer
Dim CurTimeSt As String
MustTime = Sheet1.Range("H7")
MsgBox MustTime
CurTimeSt = Sheet1.Range("I7").Text
Sheet1.Range("J7") = Mid(CurTimeSt, 1, 2) & Mid(CurTimeSt, 4, 2)
CurTime = Sheet1.Range("J7")
If CurTime > MustTime Then
MsgBox "Respond to:" + Sheet1.Range("C7")
End If
End Sub