MIN Date Value of Range

sbrotz

Board Regular
Joined
Jul 22, 2004
Messages
138
Looking for insight - appreciate the glance.

I am attempting to determine the minimum date within a dynamic range using the following:

Range("D1").Select
Selection.FormulaArray = _
"=MIN(DATA!R[1]C:R[" & NumRows - 1 & "]C)"

The information resides in the DATA worksheet, column D, starting at D2 and ending at the number of rows that are counted by the function "NumRows"
The expectation is that the result of the formula =MIN(D2:D137) be placed into the specifified cell on the starting worksheet. Upon running the macro - I error out.

What am I doing wrong?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Can you please post the full code - including that one for NumRows?

Also, use
Code:
 tags to make sure code readable. Thanks.
 
Upvote 0
I don't know how to insert code tags, but have included the requested information below

NumRows = ActiveSheet.UsedRange.Rows.Count


Range("D1").Select
Selection.FormulaArray = _
"=MIN(DATA!R[1]C:R[" & NumRows - 1 & "]C)"

Appreciate the view......
 
Upvote 0
To add code tags, you should type in your post:

Code:
then paste your code, and lastly, type:

['/code]

WITHOUT the ' in front of the /

Thanks for the consideration.
 
Upvote 0
Wigi - that did the trick. Appears I was trying to make it more complicated than what needed to be.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

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