Hi all,
I using a code to display a array of texts which sometimes increases more than 1024 characters that Msgbox can accommodate.
If the result is Morethan 1023 characters, it is getting truncated. So I am hoping for a workaround.
Please help.
Option Compare Text
Sub Find_Old_And_New_Acct_Head()
'To Find the Existing Account Head No and New Account Code Using the Existing Account Head nomenclature
Dim ExistAccHead As String, TheResult As String
Dim Cell As Range
Dim wkb As Workbook
Set ActWks = ActiveSheet
Application.ScreenUpdating = False
Application.FindFormat.Clear 'yes
Application.ReplaceFormat.Clear 'yes
ExistAccHead = InputBox("Enter the Account Head Nomenclature")
If ExistAccHead = "" Then Exit Sub
Set wkb = Workbooks.Open("F:\Exist_Final_Acc_Map.xls")
wkb.Activate
With Worksheets("Exist Vs. New")
Sheets("Exist Vs. New").Activate
For Each Cell In Range("C:C") 'Existing Account Head Column
'For Each Cell In Range("C1", Range("C1").End(xlDown)) 'Existing Account Head Column
If Cell Like "*" & ExistAccHead & "*" Then
TheResult = TheResult & Cell & " -- Old Acct Head is -- : " & Cell.Offset(0, -2).Value & " -- New Acct Head is -- : " & Cell.Offset(0, 1).Value & vbCrLf
End If
Next Cell
If TheResult = "" Then TheResult = "Account Head Not Found"
End With
MsgBox TheResult
wkb.Close
ActWks.Activate
Set ActWks = Nothing
End Sub
Bookmarks