Date and Time Format

adamswalwell

New Member
Joined
Nov 4, 2005
Messages
29
I would like to put in an equation which will automatically (dependant on how my computers date and time is set) update itself.

I have tried =Now() but that only brings up the time and unless you re-calculate nothing else happens. I was thinking that maybe in control panel i could set it up but I have tried it and it won't happen.

Therefore if anybody knows anything about this please help!!
 
I'd put it in a module and assign to a button called stock check, AND I'd put a call to the same routine from within the code for the passworded macro button.
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
so therefore i would put into the macro code after the password code but before the end sub the code you have suggested and also put that on a macro button which will therefore do the same
 
Upvote 0
Have the new code in a new module, named as "CheckStock" or whatever. Have a call to CheckStock in the button code, and also a call to CheckStock into your password code area before the End Sub. That way there is only one set of code that does the stock checking.

For the button, the code may look something like this:
Code:
Private Sub CommandButton1_Click()
    CheckStock
End Sub

And that reference to "CheckStock" calls your macro, and that's just the kind of thing you stick in your other macro too.
 
Upvote 0
After changing the code to fit in with all the information that i have (shown below) i am still recieveing a problem on the " If Worksheets(mysheets(myindex)).Range(c.Value & "StockTotal").Value < c.Offset(0, 1) Then" line below and i was wondering whether you could help:

Sub StockCheck()
mysheets = Array("Chips", "Fish", "Kebab", "Boxed and Single", "Burgers", "Pasties&Pies", "Drinks Other Items", "Southern Fried Chicken", "Packaging")

myranges = Array("Chip", "AllFish", "AllKebabs", "BoxedandSingle", "AllBurgers", "PastiesandPies", "AllDrinks", "Other", "SFC", "Packaging")

mystring = ""
For myindex = 0 To UBound(mysheets)
For Each c In Worksheets("Trigger Levels").Range(myranges(myindex))
If Worksheets(mysheets(myindex)).Range(c.Value & "StockTotal").Value < c.Offset(0, 1) Then
mystring = mystring & mysheets(myindex) & " : " & c.Value & " below " & c.Offset(0, 1).Value & Chr(10)
End If
Next
Next

If mystring <> "" Then MsgBox mystring


End Sub
 
Upvote 0
Does it crash with an error, and then prompt for End/Debug? ( what's the error exactly ? )

If so, go into Debug mode, and use the Immediate Window to find out the values of things at that point in the code ( do View/Immediate if you can't see the Immediate Window ).

( to get information by using the Immediate Window, type
? c.Value
and press Enter )
 
Upvote 0
it comes to end/debug error

when i do as you say with the immediate window it gives the error object does not support this property or method!

is there any way i can get this document to you (over the internet) for you to see
 
Upvote 0
Yes, you can ... although your error points to an object being referenced that does not exist ... for example, one the ranges being mispelled or not defined, as appear in your list.

Send it to Excelman at Lycos.co.uk and I'll have a look.
 
Upvote 0

Forum statistics

Threads
1,224,798
Messages
6,181,038
Members
453,014
Latest member
Chris258

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