Getting Data Validation Min/Max with VBA

bdaman

New Member
Joined
Jul 13, 2017
Messages
10
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have a workbook that asks quite a few questions restricted with data validations. For the ones with Whole Number or Decimal Validations I would like to give the users some help since the min & max would not be the same per question. I want to have VBA loop through every cell in the column where they could enter responses and set a "Note/Comment" on the cell that tells what type of validation is required, and the Min & Max they can enter so they dont have to just keep trying numbers until they figure out what the range is set to. I have everything working as expected, but I just cannot figure out how to READ the Min & Max that is set on the cell.

The finished note would look like this:


Code:
Validation Type:  Whole Number
Min: 8
Max: 39

I am hoping that this can be automated since I am looking at 300+ cells that this would apply to right now with all different kinds of validation min & max set. Additionally I would add a button the the Admin Form so that somebody other than myself could wipe then re-set all the notes when people other than myself maintain this later on.

Any help to figure out how to read the MIn & Max is appreciated.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Question: Where and how do you define the cell, min value, max value in VBA?
 
Upvote 0
Question: Where and how do you define the cell, min value, max value in VBA?
The Data Validation is all set on the front side from the ribbon button dialog box. Sadly not by VBA where I could reference and pull while it gets set.
 

Attachments

  • 2021-06-22 20_33_28.png
    2021-06-22 20_33_28.png
    8.5 KB · Views: 39
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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