boim
Board Regular
- Joined
- Dec 14, 2009
- Messages
- 54
Hi,
I want to process table columns based on the column name. Some columns will be deleted, some will have its format changed, etc. I try the SELECT statement; however, I also want to make the delimited list in the CASE statement dynamic (not hard-coded).
Ex:
The problem is that if I define ListColName as a string of """Name1"",""Name2"",""Name3""", it doesn't work because it's apparently regarded as just one string by VBA instead of a delimited list of strings.
So,
1. How do I go about this?
2. Perhaps a different way of doing the same job?
Thanks
I want to process table columns based on the column name. Some columns will be deleted, some will have its format changed, etc. I try the SELECT statement; however, I also want to make the delimited list in the CASE statement dynamic (not hard-coded).
Ex:
Code:
For Each col in myTable.ListColumns
Select Case col.Name
Case ListColName1
do this...
Case ListColName2
do that...
End Select
Next
The problem is that if I define ListColName as a string of """Name1"",""Name2"",""Name3""", it doesn't work because it's apparently regarded as just one string by VBA instead of a delimited list of strings.
So,
1. How do I go about this?
2. Perhaps a different way of doing the same job?
Thanks