Use a cell as the range in my VBA

scassells

New Member
Joined
Aug 8, 2018
Messages
13
Trying to use the contents of D% as my range when running the below MACRO. Not clear why the below will not work.

Sub TLANE_ERROR_Summary_Update()

' TLANE_ERROR_Summary_Update Macro


Call CLEARTLANE


Dim cl As Range


Dim myRange As Range


Set myRange = Range("D5")


For Each cl In Range(myRange.Select)


Sheets("TMODE_TLANE_PIR_HEALTH CHECK").Select


Range("H4") = cl


Call TMODE_TLANE_ERROR


Next cl


Call sortTLANE

Call Select_TLANE


End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
If D5 contains a string that represents a range reference try this.
Code:
For Each cl In Range(myRange.Value)
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

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