Dougie1
Board Regular
- Joined
- Jul 27, 2007
- Messages
- 212
Hi all,
Using Excel 2003
I currently am using this module of code :
which looks at column A and finds every occurence of a 1 then offsets to pull the value from column B into column A where it has found a 1.
How would I expand this code so that it will also look at column A for every occurence of a 2, 3, 4, 5, 6, 7, 8, 9 or 10 but will offset to pull the value from column C into column A where it has found a 2, 3, 4, 5, 6, 7, 8, 9 or 10 ?
TIA
D
Using Excel 2003
I currently am using this module of code :
Code:
Sub ID
Dim Rng1, c As Range, LastRow As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Set Rng1 = Range("A1:A" & LastRow)
For Each c In Rng1
If UCase(c) = "1" Then
c = c.Offset(0, 1)
End If
Next
End Sub
which looks at column A and finds every occurence of a 1 then offsets to pull the value from column B into column A where it has found a 1.
How would I expand this code so that it will also look at column A for every occurence of a 2, 3, 4, 5, 6, 7, 8, 9 or 10 but will offset to pull the value from column C into column A where it has found a 2, 3, 4, 5, 6, 7, 8, 9 or 10 ?
TIA
D