ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[¤À¨É] ¦brange¤¤´M§ä¦Û¤w·Q­nªº­È¡A¨Ã¥B©³®æÅܦâ

[¤À¨É] ¦brange¤¤´M§ä¦Û¤w·Q­nªº­È¡A¨Ã¥B©³®æÅܦâ

µ¹¦U¦ì§@¤À¨É¤F¡A¤p§Ì¤]¬O±q½×¾Â¤W§ä¸ê®Æ¦Û¤w½sĶªº¡C
Sub Find()
Dim FindString As Integer
Dim FirstAddress As String
FindString = InputBox("½Ð¿é¤J¼Æ­È")
Dim oRng As Range
Set oRng = Range("E1:I3000").Find(what:=FindString, LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlRows, matchbyte:=True)
If Not oRng Is Nothing Then
FirstAddress = oRng.Address
Do
Debug.Print oRng.Row, oRng.Address, oRng.Value
Set oRng = Range("E1:I3000").FindNext(oRng)
oRng.Interior.ColorIndex = 4
oRng.Offset(0, 7).Interior.ColorIndex = 4
Loop While Not oRng Is Nothing And oRng.Address <> FirstAddress
End If
End Sub

³á¡A¹ï¤F
oRng.Offset(0, 7).Interior.ColorIndex = 4
¥i¥H§Ë°£¡A¦]¬°¤p§Ì¬O¦³¹ï·Ó¨âªÌ¦P®É·|Åܦâ¡C

TOP

¦^´_ 2# pegawang
¤]¥i¦p¦¹¼gªk
  1. Option Explicit
  2. Sub Ex()  'Sub Find()  :Find ¬OVBA±MÄݪº¤å¦rµ{¦¡ªº¦WºÙÁקK¨Ï¥Î
  3.     Dim FindString As String
  4.     FindString = InputBox("½Ð¿é¤J¼Æ­È")
  5.     If FindString <> "" Then
  6.         With Range("E1:I3000")
  7.             .Cells.Replace FindString, "=1/0", xlWhole           '**¿é¤Jªº¤å¦r´À´«¬°¿ù»~­È
  8.             On Error Resume Next                                          '**¤£²z·|µ{¦¡¤Wªº¿ù»~,Ä~Äò°õ¦æµ{¦¡
  9.            With .SpecialCells(xlCellTypeFormulas, xlErrors)  '**¨S¦³¿ù»~­È, µ{¦¡·|¿ù»~¦Ó¤¤Â_
  10.                 If Err = 0 Then
  11.                     .Parent.Cells.Interior.ColorIndex = xlNone
  12.                     .Value = FindString
  13.                    .Interior.ColorIndex = 4
  14.                 Else
  15.                     MsgBox "§ä¤£¨ì  " & FindString
  16.                 End If
  17.             End With
  18.         End With
  19.     End If
  20. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¤Ñ§r..¤p§Ì¤£§÷¡Aª©¥D¼gªºµ{¦¡¥i±o¦n¦n¬d®Ñ®ø¤Æ¤@µf¡C

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD