Hi guys,
i have this code:
Sub Start()
On Error GoTo ERRORHANDLER
ActiveWorkbook.Save
Dim SProd As String
Dim SFreq As String
Dim SAccAge As String
SProd = Sheets("Cover").Range("B1").Value
SFreq = Sheets("Cover").Range("J7").Value
SAccAge = Sheets("Cover").Range("M7").Value
Sheets("Clean").Activate
If SAccAge = "Oldest" Then
Range("AU1").Select
Range("A1:CX25000").Sort Key1:=Range("AU1"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ElseIf SAccAge = "Newest" Then
Range("AU1").Select
Range("A1:CX25000").Sort Key1:=Range("AU1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If
Range("E2").Select
RESTART:
Do Until ActiveCell.Offset(0, 8).Value = SProd And ActiveCell.Offset(0, 29).Value = SFreq
ActiveCell.Offset(1, 0).Select
Loop
If ActiveCell.Offset(0, 97).Value <> "" Then
ActiveCell.Offset(1, 0).Select
GoTo RESTART
End If
ActiveCell.Offset(0, 97).Value = "Worked"
Worksheets("Cover").Range("A4").Value = ActiveCell.Value
Worksheets("Cover").Range("A6").Value = ActiveCell.Offset(0, 3).Value ' Bill Status
Worksheets("Cover").Range("A8").Value = ActiveCell.Offset(0, 1).Value ' New Flag
Worksheets("Cover").Range("A10").Value = ActiveCell.Offset(0, 66).Value ' Port Rec
Worksheets("Cover").Range("A12").Value = ActiveCell.Offset(0, 79).Value ' Unbilled Value
Worksheets("Cover").Range("A14").Value = ActiveCell.Offset(0, 21).Value ' Company Name
Worksheets("Cover").Range("A16").Value = ActiveCell.Offset(0, 67).Value ' Unbilled Reason
Worksheets("Cover").Activate
ActiveWorkbook.Save
FrmAcc.Show
Exit Sub
ERRORHANDLER:
MsgBox ("Please wait a few moments and try again, a colleague is accessing account data"), vbInformation
Exit Sub
End Sub
Now when i change range G7 from E to G the code still pics up an account that has a G? i have to then exit and press "get account" again to get the desired results?
i figure this is like a refresh problem? any ideas?
Cheers for reading my thread!!
Bookmarks