Data Validation Formula changes to VBA Code
Closed
smuneeb
Posts
67
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
-
Nov 7, 2015 at 07:19 PM
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 - Nov 9, 2015 at 03:38 PM
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 - Nov 9, 2015 at 03:38 PM
Related:
- Excel vba data validation
- Number to words in excel formula without vba - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Display two columns in data validation list but return only one - Guide
- Vba case like - Guide
- Tmobile data check - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Nov 9, 2015 at 09:41 AM
Nov 9, 2015 at 09:41 AM
you need to understand the code to see what it is doing
This is a range
"D11:D510"
you cannot check range as "D11:D510").Value = "Best"
This is a range
"D11:D510"
you cannot check range as "D11:D510").Value = "Best"
Nov 9, 2015 at 12:43 PM
Thanks
Nov 9, 2015 at 01:32 PM
'The Me keyword behaves like an implicitly declared variable. It is automatically available to every procedure in a class module. When a class can have more than one instance, Me provides a way to refer to the specific instance of the class where the code is executing. Using Me is particularly useful for passing information about the currently executing instance of a class to a procedure in another module
'Range("D11:D510").Value = "Best" is checking if range value is equal to BEST. Think for a second. On excel sheet, would you ever say for a group of cells a singel value. I think you would say answer is NO. So what to do, would depends on what you want to check. You may want to check of each cell in range has that value or at least once cell has it etc.
So these lines will never work. you have to examine one cell at a time in a range
If (Me.Range("D11:D510").Value = "Best") Or (Me.Range("D11:D510").Value = "Worst") Then
I am not too sure what exactly and how exactly you are planning to use, Based on your previous questions, i thought you had the solution that you seek.
Nov 9, 2015 at 02:00 PM
In the end I perceived that I have to set Range as variable then call it for procedure
Nov 9, 2015 at 03:18 PM
1. You want to validate input in column B and E by checking value in column D
so if a cell in column D has "best" or "worst", then for that row, you want to clear out values from column B and Column E
Or is it some thing else
Nov 9, 2015 at 03:38 PM