|
- If Left(MyNamea, 3) = "xls" Then
- Cells(i, 2) = "Excel文件"
- ElseIf Left(MyNamea, 3) = "doc" Then
- Cells(i, 2) = "Word文件"
- ElseIf Left(MyNamea, 3) = "ppt" Then
- Cells(i, 2) = "Powerpoint文件"
- ElseIf Left(MyNamea, 3) = "rar" Then
- Cells(i, 2) = "Rar压缩文件"
- ElseIf Left(MyNamea, 3) = "zip" Then
- Cells(i, 2) = "Zip压缩文件"
- ElseIf Left(MyNamea, 3) = "jpg" Then
- Cells(i, 2) = "Jpg图片"
- ElseIf Left(MyNamea, 3) = "png" Then
- Cells(i, 2) = "Png图片"
- ElseIf Left(MyNamea, 3) = "jpeg" Then
- Cells(i, 2) = "Jpeg图片"
- ElseIf Left(MyNamea, 3) = "bmp" Then
- Cells(i, 2) = "Bmp图片"
- ElseIf Left(MyNamea, 3) = "gif" Then
- Cells(i, 2) = "Gif图片"
- ElseIf Left(MyNamea, 3) = "cdr" Then
- Cells(i, 2) = "Cdr文件"
- ElseIf Left(MyNamea, 3) = "psd" Then
- Cells(i, 2) = "Photoshop文件"
- ElseIf Left(MyNamea, 2) = "ai" Then
- Cells(i, 2) = "AI文件"
- Else
复制代码 怎样简化上面这样累赘的if语句,谢谢!
|
|