Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel Looping Question on multiple ranges...

I have a code that loops on selected range ex. A1:B4.. the looping
starts from A1:B1 then it goes on the second row that is A2:B2 (it
starts from left to right and goes on the second row)...Now my question
is, would there be a way VBA to know when it starts to process a new
row like A3:B3? Here's my code: What I want to do is for it to be smart
enought to populate values at the start of every new row based on the
range. I appreciate any help...

For Each r In Sheets(5).Range(A1:B4).Cells
If (I want that piece of code entered here, if there is)
Then
xlapp.ActiveWorkbook.Worksheets(4).Select
Range("A1").Select
Do Until IsEmpty(ActiveCell.Offset(x, 0))
x = x + 1
Loop
n = 1
End If
i = 0
sArray = Split(r & "ý", "ý")
With xlapp
.ActiveWorkbook.Worksheets(4).Select
last = UBound(sArray) - 1
Do Until i last
Cells(i + 1 + x, n).FormulaR1C1 = CStr(sArray(i))
i = i + 1
Loop
.ActiveWorkbook.Worksheets(5).Select
End With
n = n + 1
'Next t
't = t + 1
Next r

Reply
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
LOOPING multiple ranges Jase Excel Discussion (Misc queries) 1 April 7th 08 06:21 PM
Looping through dynamic ranges from multiple worksheets TechWrangler Excel Programming 0 May 8th 06 08:20 PM
Looping through named ranges JFamilo[_12_] Excel Programming 2 August 17th 05 02:23 PM
Any easier way than looping on ranges Billabong Excel Programming 1 August 27th 04 10:32 AM
Looping in Excel XP with C# -- Ranges and SpecialCells craigd Excel Programming 4 April 15th 04 03:33 AM


All times are GMT +1. The time now is 06:36 AM.

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"