Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help for Visual Basic Find
Hi,
I am trying to develop a macro. I need to do do a find in Japanese Kanji. (Double byte). Whenever I do copy and paste from excel sheet to Visual Basic editor that kanji character changes to "??". Could any one help me for searching a double byte character in VBA, Rest all words are in English. Any help would be higly appreciated. Thanks in advance. -- Kittie |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help for Visual Basic Find
figure out what the AscW value is an use that with ChrW as your search
target. -- Regards, Tom Ogilvy "Lolly" wrote in message ... Hi, I am trying to develop a macro. I need to do do a find in Japanese Kanji. (Double byte). Whenever I do copy and paste from excel sheet to Visual Basic editor that kanji character changes to "??". Could any one help me for searching a double byte character in VBA, Rest all words are in English. Any help would be higly appreciated. Thanks in advance. -- Kittie |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
help for Visual Basic Find
Hi, Tom Thanks for the reply. I have the value for AscW.It's "8d87" and "8C76". I wanted to find these values in excel sheet and then replace next two cells by blank . If you could help me on this further I would appreciate it. Here are my codes. Set rng1 = Range("A:B").Find(What:="* ??", _ After:=rng, _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchByte:=True) If Not rng1 Is Nothing Then sAddr = rng1.Address Do If rng1.Column = 1 Then rng1.Offset(0, 1).Resize(, 3).ClearContents ElseIf rng1.Column = 2 Then rng1.Offset(0, -1).ClearContents rng1.Offset(0, 1).Resize(, 3).ClearContents End If Set rng1 = Range("A:B").FindNext(rng1) Loop While rng1.Address < sAddr End If Thanks a lot Tom Ogilvy wrote: figure out what the AscW value is an use that with ChrW as your search target. -- Regards, Tom Ogilvy "Lolly" wrote in message ... Hi, I am trying to develop a macro. I need to do do a find in Japanese Kanji. (Double byte). Whenever I do copy and paste from excel sheet to Visual Basic editor that kanji character changes to "??". Could any one help me for searching a double byte character in VBA, Rest all words are in English. Any help would be higly appreciated. Thanks in advance. -- Kittie |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
help for Visual Basic Find
I don't have anything to test it on, but my suggestion was:
c& = clng("&H" & "8d87") Set rng1 = Range("A:B").Find(What:=ChrW(c&), _ After:=rng, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchByte:=True) If Not rng1 Is Nothing Then sAddr = rng1.Address Do If rng1.Column = 1 Then rng1.Offset(0, 1).Resize(, 3).ClearContents ElseIf rng1.Column = 2 Then rng1.Offset(0, -1).ClearContents rng1.Offset(0, 1).Resize(, 3).ClearContents End If Set rng1 = Range("A:B").FindNext(rng1) Loop While rng1.Address < sAddr End If -- Regards, Tom Ogilvy wrote in message ups.com... Hi, Tom Thanks for the reply. I have the value for AscW.It's "8d87" and "8C76". I wanted to find these values in excel sheet and then replace next two cells by blank . If you could help me on this further I would appreciate it. Here are my codes. Set rng1 = Range("A:B").Find(What:="* ??", _ After:=rng, _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchByte:=True) If Not rng1 Is Nothing Then sAddr = rng1.Address Do If rng1.Column = 1 Then rng1.Offset(0, 1).Resize(, 3).ClearContents ElseIf rng1.Column = 2 Then rng1.Offset(0, -1).ClearContents rng1.Offset(0, 1).Resize(, 3).ClearContents End If Set rng1 = Range("A:B").FindNext(rng1) Loop While rng1.Address < sAddr End If Thanks a lot Tom Ogilvy wrote: figure out what the AscW value is an use that with ChrW as your search target. -- Regards, Tom Ogilvy "Lolly" wrote in message ... Hi, I am trying to develop a macro. I need to do do a find in Japanese Kanji. (Double byte). Whenever I do copy and paste from excel sheet to Visual Basic editor that kanji character changes to "??". Could any one help me for searching a double byte character in VBA, Rest all words are in English. Any help would be higly appreciated. Thanks in advance. -- Kittie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do you use visual basic to find cross product of two vectors | Excel Worksheet Functions | |||
Can I run Visual Basic procedure using Excel Visual Basic editor? | Excel Programming | |||
Using FIND in Visual Basic | Excel Programming | |||
Where do I find help for Visual Basic for Applications Extensibili | Excel Programming | |||
Visual Basic code to find next available (blank) row in a spreadsh | Excel Programming |