vba code for unicode

gsrikanth

Board Regular
Joined
Jan 7, 2012
Messages
210
Below vba code to highlight non-unicode cells, as it make non-unicode to unicode also please suggest
<CODE>
Sub Dimitris2()
Dim cell As Range, weird As Boolean, cnt&
cnt = 0
For Each cell In ActiveSheet.UsedRange
weird = False
If Not IsError(cell) Then
If Len(cell) > 0 Then
Select Case Evaluate("=trim(code(" & cell.Address & "))")
Case 63 ' question mark
weird = True
Case 10 ' new line
weird = True
End Select
If weird Then
cell.Interior.Color = RGB(250, 250, 5)
cnt = cnt + 1
End If
End If
End If
Next
MsgBox cnt & " cells were highlighted."
End Sub
</code>
 
Last edited:

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Below vba code to highlight non-unicode cells, as it make non-unicode to unicode also please suggest
<code><code>
Sub Dimitris2()
Dim cell As Range, weird As Boolean, cnt&
cnt = 0
For Each cell In ActiveSheet.UsedRange
weird = False
If Not IsError(cell) Then
If Len(cell) > 0 Then
Select Case Evaluate("=trim(code(" & cell.Address & "))")
Case 63 ' question mark
weird = True
Case 10 ' new line
weird = True
End Select
If weird Then
cell.Interior.Color = RGB(250, 250, 5)
cnt = cnt + 1
End If
End If
End If
Next
MsgBox cnt & " cells were highlighted."
End Sub</code>
</code>


<code>
this సత్యనారాయణ
code to ‹¬`Ǽ<Œ~Œ†Ç°}›

system under standing code
</code>
 
Upvote 0
Hello,

I don't understand your code.

Maybe this gives you a inspiration: given a text in cells(1,1)

Code:
function IsUnicode(rng as range) as boolean
dim By() as Byte
By = rng.value
for i = 1 to ubound(By) step 2
    if By(i) <> 0 then IsUnicode = true : exit sub
next
end function

regards

(written out of memory, mistakes are likely)
 
Upvote 0
this code for changing complete word or single character in the cell
and also error comming Exit sub not allowed in fuction or property
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top