|
* 답변하시는 분들께 도움이 되도록 자신의 환경을 아래 항목 옆에 기재해 주세요.
- 엑셀 버전(95,97,2000,xp,2003,2007):
* 아래줄에 질문을 작성하세요 >> 숫자와 문자로 된 셀들중에서 숫자만 찾아 색을 변환시키고 싶습니다.
Sub test1()
Dim intASC As Integer
Dim cnt As Integer
Dim str As String
Dim str1 As String
For i = 1 To 100
str = Cells(i, 1).Value
cnt = Len(str)
For j = 1 To cnt
str1 = Mid(str, j, 1)
intASC = Asc(str1)
If (intASC >= 48 And intASC <= 57) Then
With Cells(i, 1).Characters(Start:=j, Length:=1).Font
.Color = -16776961
End With
End If
Next j
Next i
End Sub
일단 코드는 어떻게 짰는데 범위가 a로만 고정되어 곤란합니다...
드래그로 지정범위 바꿀수 있는 방법 도와주시면 감사드리겠습니다.. |
|