tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
My workbook as 2 worksheets, codenames are Data and Input.
In Input, I have some cell references, such as:
The code below looks at the cells in the worksheet Data.
This code works.
However, if one of the cell reference is multiple, it fails.
How can I adapt my code so that even if the user enters a multiple cell reference, such as A1:A10, it would work?
Thanks
In Input, I have some cell references, such as:
Code:
A1
A2
A10
The code below looks at the cells in the worksheet Data.
Code:
Dim CheckRng As Range
With Input
Set CheckRng = .Range(.Cells(1, 6), .Cells(10, 6))
End With
Dim CheckRngElement As Range
For Each CheckRngElement In CheckRng
If Data.Range(CheckRngElement).Value = vbNullString Then
' do something
End If
Next
This code works.
However, if one of the cell reference is multiple, it fails.
Code:
A1:A10
A11
B20:B30,B40:B50
How can I adapt my code so that even if the user enters a multiple cell reference, such as A1:A10, it would work?
Thanks