Hi,
I have the following macro that works perfectly when running under XP operating system but we have been upgrading the pc's to run windows 7 and now it does not work.
It runs through nd returns the message box stating that the date is not found, when i step the macro through a line at a time in VB it works, can some help me as to why it does not work under windows 7?
Regards,
I have the following macro that works perfectly when running under XP operating system but we have been upgrading the pc's to run windows 7 and now it does not work.
It runs through nd returns the message box stating that the date is not found, when i step the macro through a line at a time in VB it works, can some help me as to why it does not work under windows 7?
Rich (BB code):
Private Sub Copy_Data()
Dim user As String
Run "Compare"
If Sheets("Entry").Range("A34").Value > 0 Then Exit Sub
Run "Find_User"
Dim FindString As Date 'FIND DATE ON DATA TAB
Dim rng As Range
If Hour(Now) > 6 Then
MsgBox "The Update Can Only be Run Between 00:00 & 07:00", vbCritical, "Update Not Run"
Exit Sub
End If
Application.ScreenUpdating = False
Sheets("Entry").Range("Entry").Copy
FindString = Sheets("Entry").Range("D6")
With Sheets("Data").Range("7:7")
Set rng = .Find(What:=FindString, After:=.Cells(.Cells.Count), LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
If Not rng Is Nothing Then
Application.GoTo rng, True
Else
MsgBox "Date Not Found, Enter a Valid Date", 48, "Invalid Date"
GoTo Finished
End If
End With
ActiveCell.Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
ActiveSheet.Range("b1").End(xlDown).Offset(0, 0).Select
With Sheets("Tracker")
.Cells(.Rows.Count, "F").End(xlUp).Offset(1).FormulaR1C1 = user
.Cells(.Rows.Count, "E").End(xlUp).Offset(1) = Now
End With
On Error Resume Next
ThisWorkbook.Save
Finished:
Sheets("Entry").Select
Range("D8:D33").Select
Selection.ClearContents
Range("D8").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Regards,