Help with macro

Damo10

Active Member
Joined
Dec 13, 2010
Messages
460
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?

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,
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top