ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Evening,
I am using the code below which selects cell A after the last row with values in when i open my worksheet.
I would like this cell to be Interior.ColorIndex = 8 but i keep getting Not Defined message.
Can you advise what ive missed please.
I am using the code below which selects cell A after the last row with values in when i open my worksheet.
I would like this cell to be Interior.ColorIndex = 8 but i keep getting Not Defined message.
Can you advise what ive missed please.
Rich (BB code):
Private Sub Worksheet_Activate()
Application.GoTo Sheets("POSTAGE").Range("A" & Rows.Count).End(xlUp).Offset(1, 0), True
ActiveWindow.SmallScroll UP:=15
Dim answer As Integer
answer = MsgBox("DO YOU WISH TO OPEN THE USERFORM", vbQuestion + vbYesNo + vbDefaultButton2, "POSTAGE OPEN USERFORM MESSAGE")
If answer = vbNo Then
Exit Sub
Else
Dim ws As Worksheet, lRow As Long, i As Long
Set ws = Application.Worksheets("POSTAGE")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Row ' count total rows using A col
For i = 8 To lRow ' <-- change number rows to check here
If ws.Range("G" & i).Value = "POSTED" Then
PostageTransferSheet.Show
Exit Sub
End If
Next i
MsgBox "NO NAMES TO SHOW AS ALL PARCELS HAVE NOW BEEN DELIVERED", vbInformation, "POSTAGE DATE TRANSFER SHEET MESSAGE"
End If
Active.cell = Interior.ColorIndex = 8
End Sub