Home Using cell contents to set a range variable
Reply: 0

Using cell contents to set a range variable

user595 Published in March 22, 2018, 9:40 pm

I'm trying to run code on a range that changes through different iterations of a loop. Here is what I would like the code to run if the value in range("SearchBy") = ZeroCounts

Dim WorkRange As range
Set WorkRange = range("ZeroCounts")

Here is how I am attempting to solve this but I can't find a way that works without returning errors. Any ideas?

Dim dummy As String
dummy = """" & range("SearchBy").Value & """"

Dim WorkRange As range
WorkRange = Sheets("HungarianAlgorithm").range(dummy)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303909 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO