Whaletacos
New Member
- Joined
- Aug 10, 2017
- Messages
- 13
Hi everybody.
I've been tinkering with a small code section using the Currentregion and trying to offset a case based on it
What I was hoping for, was a currentregion.rows.count = x, lets say 10.
Then for each of those 10 rows, it would apply the cases below on offset(0,12) and (0,13).
I hope anybody is able to help a vba novice. I'm sure it is something rather simple I am missing out on.
Kind regards
WhaleTacos
I've been tinkering with a small code section using the Currentregion and trying to offset a case based on it
What I was hoping for, was a currentregion.rows.count = x, lets say 10.
Then for each of those 10 rows, it would apply the cases below on offset(0,12) and (0,13).
I hope anybody is able to help a vba novice. I'm sure it is something rather simple I am missing out on.
Kind regards
WhaleTacos
Code:
Sub cases()
Dim rngCell As Range
Dim rngStart As Range
Dim lngRows As Long
Set rngStart = Range("B2").CurrentRegion
lngRows = rngStart.CurrentRegion.Rows.Count
For Each rngCell In rngStart
With rngCell.Offset(0, 0)
Select Case rngCell.Value
Case Is = "5Cal540"
.Value = "5CalF"
Case Is = "Qua705"
.Value = "Quasar 705"
End Select
End With
Next rngCell
End Sub