If trim(shtName) <> "" Then If Len(shtName) > 30 Then shtName = Left(shtName, 30) shtName = Replace(shtName, "/", "") shtName = Replace(shtName, "/", "") shtName = Replace(shtName, "[", "") shtName = Replace(shtName, "]", "") shtName = Replace(shtName, "*", "") shtName = Replace(shtName, "*", "") shtName = Replace(shtName, "¥", "") shtName = Replace(shtName, "\", "") shtName = Replace(shtName, ":", "") shtName = Replace(shtName, ":", "") shtName = Replace(shtName, "?", "") shtName = Replace(shtName, "?", "") ActiveWorkbook.Worksheets.Add(after:=Worksheets(Worksheets.Count)).Name = shtName End If
2011年12月28日水曜日
Excel vba シート追加、名前変更のエラー防止、「暴力」チェッカー
ラベル:
vba
excelのシートいろいろ禁止文字が有るみたい、暴力的に禁止字を排除する
登録:
コメントの投稿 (Atom)
0 件のコメント:
コメントを投稿