- Katılım
- 17 Mayıs 2012
- Mesajlar
- 102
- Excel Vers. ve Dili
- Office 2019, Türkçe
Elimde bir excel dosyam var 85 sekmeli. ve ben aşağıdaki kodu 81 ilin adından oluşan sekmelere uygulamak istiyorum. seçtiğim sekmelere uygula şeklinde de olabilir, 81 il adından oluşan sekmeleri koda katarakta olabilir. Bunu nasıl yaparım
Kod:
Sub kelime_bicimlendir()
Dim xHStr As String, xStrTmp As String
Dim xHStrLen As Long, xCount As Long, I As Long
Dim xCell As Range
Dim xArr
On Error Resume Next
Range("N33:AB40").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=R[12]C[6]"
Range("N33:AB40").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C55:J57").Select
Selection.Copy
Range("C51").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells(33, "N").Select
xHStr = Cells(51, "C")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(51, "d")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(51, "e")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(51, "F")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(51, "G")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(51, "H")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(51, "I")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(51, "J")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(52, "C")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(52, "D")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(52, "E")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(52, "F")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(52, "G")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(53, "c")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(53, "d")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(53, "e")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(53, "f")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
xHStr = Cells(53, "g")
If TypeName(xHStr) <> "String" Then Exit Sub
Application.ScreenUpdating = False
xHStrLen = Len(xHStr)
For Each xCell In Selection
xArr = Split(xCell.Value, xHStr)
xCount = UBound(xArr)
If xCount > 0 Then
xStrTmp = ""
For I = 0 To xCount - 1
xStrTmp = xStrTmp & xArr(I)
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.ColorIndex = 3
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Font.Bold = True
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Name = "Arial Black"
xCell.Characters(Len(xStrTmp) + 1, xHStrLen).Font.Size = 13
xStrTmp = xStrTmp & xHStr
Next
End If
Next
Application.ScreenUpdating = True
End Sub
