Hi,
This code is really simple, but I am getting a 400 error. Essentially, I just want the range to change, depending upon what is in cell A4. Any help is much appreciated. Thank you.
Sub dropdown()
ActiveSheet.Name = "Graph Data"
ThisType = Cells("a4").Value
Select Case Range("Ranges")
Case Is = 1
Range("R32:U36") = "GraphRange"
Case Is = 2
Range("R39:T43") = "GraphRange"
Case Is = 3
Range("R46:R50") = "GraphRange"
End Select
End Sub
Please use Code tags, not Quote tags
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
My Apologies.
Code:Sub dropdown() ActiveSheet.Name = "Graph Data" Cells("a4").Value Select Case Range("Ranges") Case Is = 1 Range("R32:U36") = "GraphRange" Case Is = 2 Range("R39:T43") = "GraphRange" Case Is = 3 Range("R46:R50") = "GraphRange" End Select End Sub
Which line causes the error? (I assume the missing "ThisType =" in the revised code is just a typo)
So long, and thanks for all the fish.
Yes it was in error. It should read:
When I run the debugger, it does not stop anywhere and only comes up with the error. Any suggestions as how to figure out exactly what the issue is?Code:Sub dropdown() ActiveSheet.Name = "Graph Data" Ranges = Cells("a4").Value Select Case Range("Ranges") Case Is = 1 Range("R32:U36") = "GraphRange" Case Is = 2 Range("R39:T43") = "GraphRange" Case Is = 3 Range("R46:R50") = "GraphRange" End Select End Sub
Code tags again please...![]()
So long, and thanks for all the fish.
I realized that right after I posted and went back and edited. Trying to break old habits!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks