Hi Team,
Can we use option compare text at top of module, instead writing dictionary compare text
Below is sample data.
Thanks
mg
Can we use option compare text at top of module, instead writing dictionary compare text
VBA Code:
Option Compare Text
Sub Dictionary_Compare()
Dim dict As New Scripting.Dictionary
With dict
' .CompareMode = 1 ' Macro gives output if I add this line
'Option Compare Text .. doesn't working for converting Compare mode, where it is used.
.Add Range("a2").Value, Range("b2").Value
Range("E2").Value = .Item(Range("D2").Value)
End With
End Sub
Below is sample data.
Book11 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Fruit | Cost | Key | Items | |||
2 | Apple | 5000 | APPLE | 5000 | |||
3 | |||||||
4 | Lower Case Key here | Upper case Key here | |||||
Sheet1 |
Thanks
mg