Try this code as well
Option Explicit
Public Sub TitleUpdate()
Const blkName As String = "TitleBlock" '<--- any block name
Dim tags As Variant
Dim atts As Variant
'' change all tags (case-sensitive), remove extras
tags = Array("CUSTOMER", "TITLE", "DATA", "REVISION", "DRAWN", "CHECKED", "DRAWNUM")
'' change all values (case-sensitive), remove extras
atts = Array("Obalokwande Makumbu", "Sando Stadium Project", "15.03.2012", "2", "fixo", "Big Boss", "777")
On Error GoTo Err_Control
If UBound(tags) <> UBound(atts) Then
MsgBox "Check given arrays on equal number of strings"
Exit Sub
Else
Dim i As Integer
Dim attColl As New Collection
For i = LBound(tags) To UBound(tags)
Dim tmp(0 To 1) As String
tmp(0) = tags(i): tmp(1) = atts(i)
attColl.Add Item:=tmp, key:=tags(i)
Next i
End If
Dim fType(0 To 2) As Integer
Dim fData(0 To 2) As Variant
Dim dxfCode, dxfValue
fType(0) = 0: fData(0) = "INSERT"
fType(1) = 66: fData(1) = 1
fType(2) = 2: fData(2) = blkName
dxfCode = fType: dxfValue = fData
Dim oSset As AcadSelectionSet
With ThisDrawing.SelectionSets
While .Count > 0
.Item(0).Delete
Wend
Set oSset = .Add("MySset")
End With
oSset.Select acSelectionSetAll, , , dxfCode, dxfValue
If oSset.Count = 0 Then
MsgBox "Nothing selected"
Exit Sub
Else
MsgBox "Selected " & oSset.Count & " blocks"
End If
Dim oEnt As AcadEntity
Dim oBlkRef As AcadBlockReference
Dim oBlock As AcadBlock
Dim bName As String
For Each oEnt In oSset
Set oBlkRef = oEnt
Dim attArray As Variant
attArray = oBlkRef.GetAttributes
Dim k As Integer
For i = LBound(attArray) To UBound(attArray)
Dim oAttRef As AcadAttributeReference
Set oAttRef = attArray(i)
For k = 1 To attColl.Count
If StrComp(oAttRef.TagString, CStr(attColl.Item(k)(0)), vbTextCompare) = 0 Then
oAttRef.TextString = CStr(attColl.Item(k)(1))
Exit For
End If
Next k
Next i
Next oEnt
Err_Control:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919