ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select Case issue (https://www.excelbanter.com/excel-programming/408987-select-case-issue.html)

Whit

Select Case issue
 
Hi, I am having a problem with the code below. 'Update' is pased to the macro
as a string and can only = one of the items below, but the Case Select does
not match it to any of them.

Select Case Update
Case "Finances"
Finances_Updater UpdateToolName, mybook
Case "Hierarchy"
Hierarchy_Updater UpdateToolName, mybook
Case "Both"
Hierarchy_Updater UpdateToolName, mybook
Finances_Updater UpdateToolName, mybook
End Select

thanks.

Rick Rothstein \(MVP - VB\)[_1654_]

Select Case issue
 
The first step you should do is make sure the String value you are passing
in is exactly what you think it is. Put a break point on the Select Case
Update statement and then execute this statement in the immediate window...

Print "<" & Update & ""

Then check to see if the angle brackets butt-up against the word or if there
are "extra" characters (perhaps spaces) attached to the word. Also, the Case
tests will be case-sensitive, so does the word with an upper case letter and
are the rest of the letters lower case?

Rick


"Whit" wrote in message
...
Hi, I am having a problem with the code below. 'Update' is pased to the
macro
as a string and can only = one of the items below, but the Case Select
does
not match it to any of them.

Select Case Update
Case "Finances"
Finances_Updater UpdateToolName, mybook
Case "Hierarchy"
Hierarchy_Updater UpdateToolName, mybook
Case "Both"
Hierarchy_Updater UpdateToolName, mybook
Finances_Updater UpdateToolName, mybook
End Select

thanks.




All times are GMT +1. The time now is 01:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com