Need Help Referencing Sheet

shariq1989

New Member
Joined
May 29, 2012
Messages
5
I am trying to apply a code to my List sheet. In the workbook, I have a form that feeds data to a database (Past Inspections sheet). The List sheet pulls the latest record for each Inspection category from the Past Inspections sheet and is used as a dashboard to see when the next inspection is due. I want to use the cells the Days to Go column to send out warning emails based on value. Adapting the code to this workbook sounded a lot easier than it is turning out to be. I was trying to fix one error at a time until it all worked out but have hit a roadblock with the current "Object Required" error that is popping up... The code is on Sheet3 and is pretty self explanatory. I have it the references in ws and it isnt defined because I figured i would not have to refer to ThisWorkbook if the code is going off of the specific Sheet. I just dont know how to refer to the List sheet. I just assumed referring to A14 on the sheet would be Worksheets(List).Range("A14") but thats not working...

Here is the workbook: https://docs.google.com/open?id=0BxV96LQ79jTYUWR4R3lGZUFNdUU
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to the forum!

You already have recognised the source of the error. Just remove any worksheet reference (ws) as you are using the worksheet’s SelectionChange event. All range references will be (definitely) in Sheet3 (List), so use Range("A14").End(xlUp).Row, Cells(varRow, 5).Value, etc.

Worksheets Event is worksheet specific procedure that fires when the sheet is active and the event is trapped.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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