VBA learner ITG
Active Member
- Joined
- Apr 18, 2017
- Messages
- 272
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi all,
I need your advice if possible.
I have a dataset which i am trying to determine between blank rows with variable blocks of data ranges in Column R to see if the numerical values are the same within the range and if the value are the same I want "True" and where its not exact "False" value all the way down in the range.
I have tried with the below code and I cant get past the below code as I get a : Run-time error '1004': Application or object-defined error
This is the code I am using.
I need your advice if possible.
I have a dataset which i am trying to determine between blank rows with variable blocks of data ranges in Column R to see if the numerical values are the same within the range and if the value are the same I want "True" and where its not exact "False" value all the way down in the range.
I have tried with the below code and I cant get past the below code as I get a : Run-time error '1004': Application or object-defined error
.Formula = "=AND(EXACT(" & Rng.Offset(, 1).Address(0, 0) & ")"
This is the code I am using.
Sub CHECK_RANGE()
Dim Rng As Range
For Each Rng In Range("R2", Range("R" & Rows.Count).End(xlUp)).SpecialCells(xlConstants).Areas
With Rng.Offset(Rng.Count, 1).Resize(1, 7)
.Formula = "=AND(EXACT(" & Rng.Offset(, 1).Address(0, 0) & ")"
.Value = .Value
End With
Next Rng
End Sub