Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop Through Range
I am trying to loop through a range and if the first number in the
current cell in that range is between 1 and 8 I want to concationate it with a value in another cell then past it in a cell 4 rows to the left. Below is what I trying to get to work thank you in advance. Private Sub Worksheet_Change(ByVal Target As Range) Application.ScreenUpdating = False Dim AcctRange As Range Dim CellTest As Variant Set AcctRange = Range("B5:B250") For Each CellTest In AcctRange.Cells If CellTest.Value(Left(CellTest.Value, 1) 3) And CellTest.Value(Left(CellTest.Value, 1) < 8) Then Set AcctRange.Offset(4, 0).Value = (Cells(1, 5).Value & CellTest.Value) Else Set AcctRange.Offset(, 4).Value = CellTest.Value End If Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
loop through cells in a range and pick up corresponding cell values in another range | Excel Programming | |||
How to use a Range in a Loop | Excel Programming | |||
How to Loop Through This Range and... | Excel Programming | |||
Add a Range to an existing Range in a loop? | Excel Programming | |||
Loop through a range | Excel Programming |