cell change on another sheet

gordsky

New Member
Joined
Jun 2, 2016
Messages
10
Hi,

I have a workbook with numerous worksheets ranging from 1 - 30.
Sheet 1 contains stock levels for each item within column K

Staff enter info on the specific client sheets (sheet 2 - 30) which then deducts the stock ordered from sheet 1.

(ie so if a client on sheet 3 orders 10 units of an item the master stock level on sheet 1 deducts 10 from stock available for that item in column K)

What I am trying to achieve via vba is that if data is entered in sheet 2 - 30 and it causes a cell in sheet 1 column k to drop below 0 then a message box is displayed to that effect.

I can get it to work if the changes are made directly on sheet 1 but not if they are made on a different sheet.

Any help is appreciated.
 

Some videos you may like

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"

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
5,412
Office Version
2019
Platform
Windows
Show us the layouts of the two sheets so that we can design code that specifically meets your needs.
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,730
If you want it to work on Sheet1 you can't use a worksheet_change event for column K because the change(s) are being made on sheet(s) 2-30. You have two choices:

1. Use a worksheet_calculate event on sheet1. Each time the sheet calculates it checks for quantities at or below 0 and, if present, issues a message box.
2. Use a Thisworkbook sheet_change event that monitors sheets 2-30 for changes in stock quantities that result in at or below zero values in Sheet1.
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
11,066
Office Version
2007
Platform
Windows
Hi @gordsky,

Some information is missing to complete the requirement:
- Column where the Items are on sheet1
- Column where you capture the item in the client sheet.
- Column where you capture the quantity on the client sheet.
- The quantity is always integer and greater than 0.
 

Watch MrExcel Video

Forum statistics

Threads
1,095,232
Messages
5,443,263
Members
405,220
Latest member
gtgaabaron

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top