Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default stock control

I have an inventory list online that is constantly updated. What I'm
looking to do is check and see which products are out of stock and
which have been added into stock this process happens twice a week. To
figure this out maybe would be a macro that could look at Column C
(items stock level) look and see any item with a 0 (out of stock) would
then take the mfr code (ex. ACO-AP1650) in column A and list it in
column B the products that are out of stock.

Column A ............ Column B.........Column C

ACO-AP1650.....................................5
FIS-43REJ............FIS-43REJ.............0
SAN-G34DD......................................2

Thank you for your time,

Greg


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default stock control

Greg

the following macro will give you what you want. However, why don't you just fill column B with a formula. Put the following in B2 and copy down as required.
Formula
=IF(C2,"",A2)

Macro
Sub aaa()
Range("c2").Select
While Not IsEmpty(ActiveCell)
If ActiveCell = 0 Then
ActiveCell.Offset(0, -1) = ActiveCell.Offset(0, -2)
Else
ActiveCell.Offset(0, -1) = ""
End If
ActiveCell.Offset(1, 0).Select
Wend
End Sub


Tony



----- stiv wrote: -----

I have an inventory list online that is constantly updated. What I'm
looking to do is check and see which products are out of stock and
which have been added into stock this process happens twice a week. To
figure this out maybe would be a macro that could look at Column C
(items stock level) look and see any item with a 0 (out of stock) would
then take the mfr code (ex. ACO-AP1650) in column A and list it in
column B the products that are out of stock.

Column A ............ Column B.........Column C

ACO-AP1650.....................................5
FIS-43REJ............FIS-43REJ.............0
SAN-G34DD......................................2

Thank you for your time,

Greg


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default stock control

Hi Greg:
You can call it from Sheet1's Worksheet_Change event procedure.

'example of calling from the event proedure
Private Sub Worksheet_Change(ByVal Target As Range)
CheckStock
End Sub

'place in a standard module
Sub CheckStock()
Dim lLastRow As Long, i As Integer
Dim Sh1 As Worksheet

Set Sh1 = ThisWorkbook.Worksheets("Sheet1")

lLastRow = Sh1.Cells(Rows.Count, "A").End(xlUp).Row

Application.EnableEvents = False
For i = 1 To lLastRow
If Sh1.Range("A1").Offset(i, 2).Value = 0 Then
Sh1.Range("A1").Offset(i, 1).Value = _
Sh1.Range("A1").Offset(i, 0).Value
Else
Sh1.Range("A1").Offset(i, 1).Value = ""
End If
Next i
Application.EnableEvents = True

Set Sh1 = Nothing

End Sub

Regards,
Jim Feaver

"stiv " wrote in message
...
I have an inventory list online that is constantly updated. What I'm
looking to do is check and see which products are out of stock and
which have been added into stock this process happens twice a week. To
figure this out maybe would be a macro that could look at Column C
(items stock level) look and see any item with a 0 (out of stock) would
then take the mfr code (ex. ACO-AP1650) in column A and list it in
column B the products that are out of stock.

Column A ............ Column B.........Column C

ACO-AP1650.....................................5
FIS-43REJ............FIS-43REJ.............0
SAN-G34DD......................................2

Thank you for your time,

Greg


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default stock control

Thank you, Tony and Jim for your help make my job easier.

Gre

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stock control formula Rocket Excel Worksheet Functions 0 February 9th 10 12:15 PM
stock control help sonia Excel Discussion (Misc queries) 1 March 16th 09 12:10 PM
stock control cliff Excel Discussion (Misc queries) 1 May 18th 07 01:46 PM
STOCK CONTROL IDEAS Julian Campbell Excel Discussion (Misc queries) 0 September 17th 05 05:37 PM
Stock control..help please Terry Excel Discussion (Misc queries) 0 January 13th 05 07:16 PM


All times are GMT +1. The time now is 01:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"