LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
loop through cells in a range and pick up corresponding cell values in another range [email protected] Excel Programming 9 October 19th 06 05:11 AM
How to use a Range in a Loop Glen Excel Programming 2 August 28th 06 02:51 AM
How to Loop Through This Range and... Faye[_2_] Excel Programming 3 May 3rd 06 03:29 PM
Add a Range to an existing Range in a loop? Mick Excel Programming 3 June 18th 05 06:12 AM
Loop through a range Fred[_21_] Excel Programming 6 October 22nd 04 10:45 PM


All times are GMT +1. The time now is 01:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"