Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you use visual basic to find cross product of two vectors TESHA WHYTE Excel Worksheet Functions 2 November 6th 08 05:50 AM
Can I run Visual Basic procedure using Excel Visual Basic editor? john.jacobs71[_2_] Excel Programming 3 December 26th 05 02:22 PM
Using FIND in Visual Basic Mike Excel Programming 2 November 7th 05 05:01 PM
Where do I find help for Visual Basic for Applications Extensibili Lee Hunter Excel Programming 2 October 19th 05 05:39 PM
Visual Basic code to find next available (blank) row in a spreadsh TB Excel Programming 2 July 15th 05 08:01 PM


All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"