LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default VBA / Macro Help Please

Thanks in advance this is driving me crazy!
I'm trying to create an automated ordering system based on inventory levels.
This is an inventory sheet of 59 items. I have it set to when the total for
a specific product falls underneath a specific level; it displays "order" or
"OK" using:

=IF(AJ3<2,"Order","OK")

The Problem...
I need to post only the items that appear with the "Order" status to another
sheet formatted for export into an existing Access DB. I'm far from an expert
using Macros, The only thing I could come up with is:

Private Sub Worksheet_Activate()

If Worksheets("Count").Range("AK3").Value = "Order" Then
Worksheets("Ordering Export Info").Range("A2").Value = 1 'ID Number
Worksheets("Ordering Export Info").Range("B2").Value = "Air Freshener"
'Product Description
Worksheets("Ordering Export Info").Range("D2").Value = 1 'Preset
Order Amount
Worksheets("Ordering Export Info").Range("E2").Value = Now 'Current Date
End If

If Worksheets("Count").Range("AK4").Value = "Order" Then
Worksheets("Ordering Export Info").Range("A3").Value = 2
Worksheets("Ordering Export Info").Range("B3").Value = "Alkaline"
Worksheets("Ordering Export Info").Range("D3").Value = 2
Worksheets("Ordering Export Info").Range("E3").Value = Now
End If

If Worksheets("Count").Range("AK5").Value = "Order" Then
Worksheets("Ordering Export Info").Range("A4").Value = 3
Worksheets("Ordering Export Info").Range("B4").Value = "Bleach"
Worksheets("Ordering Export Info").Range("D4").Value = 1
Worksheets("Ordering Export Info").Range("E4").Value = Now
End If

End Sub

This, for some reason only prints the first line on the second sheet. It is
not printing any of the other lines. The second and third If statements are
not working for some reason. The other problem with doing it like this is
that there would be gaps in between rows on the second sheet. I'm not sure if
that would affect the export of information to Access or not...Any Ideas???
 
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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 02:35 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"