Apply Interior.ColorIndex = 8 to active cell

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. 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.


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
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

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