Time

jeh

Active Member
Joined
Apr 27, 2002
Messages
250
Hi

Thanks to all who have helped me so far.

I have labels that are on a userform that will report the average of 60 minutes of data. I have 24 cells that I want to pull the data from.

What I hope some one will tell me is how to I set up a way of getting the right data for the right hour?

The first hour will be from 00:00 to 01:00.
I want the data drom A1. After 01:00 up until 02:00, I want the data from cell A2.

Can this be done in a way that a rookie like me can understand?

Thank you for your time,

Jim
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I'm familiar with the VBE, but I don't know how to write VB. for the most part I record macros and hack them up pretty bad. And I can usually stumble through putting code where it works any way.
 
Upvote 0
Jim
Is the crieria based upon the current time?
In any case, it seems that the Select Case Statement might be the best way to go...
If you only need the data from one cell you could also try this, assuming the hour is the current hour...

lblYourLabel.Caption = _
Sheet1.Range("A" & Hour(Now) + 1).Value

Tom
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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