troubleshooting Question

Need help with modifying my VBA code

Avatar of Skylar
Skylar asked on
VBAMicrosoft ExcelMicrosoft Office
4 Comments3 Solutions74 ViewsLast Modified:
I need help with changing two thing in my code.

one of them is  instead of hard coded path.  
Const basePath As String = "c:\Users\Skylar\Downloads\Factory"  

Open in new window

I need help to modify this, so that instead of this fixed path.  I would get a prompt to select the path from the directory. I searched google but got confused with too many different answers that i could not put to use.

the second help i need is that my current range is static from A2 to A13 i want to change is to dynamic so that if there is more value it expands the range and if the values are not there then it collapse the range.
I do not know how to change this little code below
    Dim ws As Excel.Worksheet
    Set ws = wb.Worksheets(2)
    Dim rng As Excel.Range
    Set rng = ws.Range("A2:A13")

Open in new window

Wayne Taylor (webtubbs)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros