Need help with loops

Needtoknow

Board Regular
Joined
Apr 21, 2006
Messages
73
Hey All,
I have a code that calls another part of the code that basically draws arrows. But I want the code to look at another sheet called "Task Name" and only at columns to get the From and To cell locations to help draw the arrows.

Task Names
From To
Task A E11 Task B G11
Task B G11 Task C O1
Task B G11 Task D O22


I have no idea how to do it... all I have is this:

For Each Cell In rng
Call DrawArrows(Cells(a, b), Cells(c, d), RGB(0, 0, 255))
Next Cell

I want it to loop through the range, but only for the columns on the Task name sheet and if possible go down the columns named "From" and "To"
Thanks,
Jim
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
sheets("Task Name").select
'run draw arrows
sheets("AnotherSheet").select
'run draw arrows

 
Upvote 0
Nope. I need to know how to get the text from the other cells and run it thru my other code.


Sub AddArrows()
'Call DrawArrows(Range("E11"), Range("G11"), RGB(0, 0, 255))
'Call DrawArrows(Range("b1"), Range("c4"), , "Line")
'Call DrawArrows(Range("b1"), Range("c4"), RGB(0, 0, 255), "Double")


Dim rng As Range
Dim Cell As Range
Set rng = Range("B3:B5")
Set rng2 = Range("D3:D5")
Dim i As Integer
Dim j As Integer

For Each Cell In rng

For i = 1 To 6
For j = 1 To 2
Call DrawArrows(Cells(a, b), Cells(c, d), RGB(0, 0, 255))
Next j
Next i

Next Cell

End Sub
 
Upvote 0

Forum statistics

Threads
1,222,711
Messages
6,167,790
Members
452,140
Latest member
beraned1218

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top