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

[µo°Ý] Excel VBA ¬d§ä¼gªk

[µo°Ý] Excel VBA ¬d§ä¼gªk

·Q°Ý°Ý¦U¦ì¤j¯«  ¬ã¨s¤F«Ü¤[¼g¥X¨Ó³£©Ç©Çªº
§Ú¦bA1®æ¨ç¼Æ³]©w=today()¡A©Ò¥H¨C¦¸¶}excel³£·|¸õ¤µ¤Ñ¤é´Á   
µM«á±qB1~AN1  ¬°¤@³s¦ê¤é´Á¡A(¨Ò¦p2020/05/01,2020/05/02,.......)

¤µ¤Ñ±ý³]­p¤@­Ó±±¨î«ö¶s
«ö¤@¤U¥¦·|¦Û°Ê¦bB1~AN1´M§ä¬O¤£¬OA1Ä檺¤é´Á
|³Ì«á·|°±¦b§ä¨ìªº¤é´Á¤W


§Úªº¼gªk¬O³o¼Ë..¤@ª½¥Î¤£¥X¨Ó¡A·PÁ¦U¦ì¤j¤j

Sub ¥¨¶°1()

Dim Rng As Range

Set Rng = Range("B1:AN1").Find("A1", lookat:=xlWhole)

Rng.Address

End Sub

  1. Sub tets()

  2. keyword = Range("d1")

  3. i = 1

  4. Do Until Cells(i, 1) = ""


  5. If Cells(i, 1) = keyword Then
  6.     Cells(i, 1).Select
  7.     MsgBox ActiveCell.Address
  8. End If





  9. i = i + 1
  10. Loop






  11. End Sub
½Æ»s¥N½X

123.PNG (103.9 KB)

123.PNG

TOP

¦^´_ 1# d03ey


Sub test()

Dim Rng As Range

keyword = Range("d1")


Set Rng = Range("a1:a11").Find(keyword, lookat:=xlWhole)

Rng.select


End Sub

TOP

¦^´_ 1# d03ey


»Ý¨D¡G
·Q°Ý°Ý¦U¦ì¤j¯«  ¬ã¨s¤F«Ü¤[¼g¥X¨Ó³£©Ç©Çªº
§Ú¦bA1®æ¨ç¼Æ³]©w=today()¡A©Ò¥H¨C¦¸¶}excel³£·|¸õ¤µ¤Ñ¤é´Á   
µM«á±qB1~AN1  ¬°¤@³s¦ê¤é´Á¡A(¨Ò¦p2020/05/01,2020/05/02,.......)
¤µ¤Ñ±ý³]­p¤@­Ó±±¨î«ö¶s
«ö¤@¤U¥¦·|¦Û°Ê¦bB1~AN1´M§ä¬O¤£¬OA1Ä檺¤é´Á
|³Ì«á·|°±¦b§ä¨ìªº¤é´Á¤W

¨SÀÉ®×´ú¸Õ¡ã¡ã¡ã¦Û¤v¸Õ¬Ý¬Ý§a¡I

Sub ¥¨¶°1()
[B1:AN1].Find([A1], , xlValues, xlWhole).Select
End Sub
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¥»©«³Ì«á¥Ñ d03ey ©ó 2020-6-18 01:00 ½s¿è

¦^´_ 1# d03ey
¼Ó¤W¨â¦ì¤j¤j¡A§Ú³£¦³´ú¸Õ¤F¦ý·|¶i¤Jdebug

¤U­±¬O´ú¸ÕÀÉ(¼g¥¢±Ñªº)


    Test Find.rar (14.27 KB)

TOP

¦^´_ 5# d03ey


§Úªºµ{¦¡¨S¦³°ÝÃD³á~~

Test Find++.rar (12.47 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 5# d03ey


keyword = Range("a1")
Set Rng =(Range("D3:AN3").Find(keyword,lookat:=xlWhole)

¦h¤F¤@¥ª¬A¸¹(
·j´M¤£¦b²Ä 3 ¦C

TOP

¦^´_ 6# n7822123


    ·PÁ­ô~¦¨¥\¤F ·P¿E¤£ºÉ

TOP

¦^´_ 7# ­ã´£³¡ªL


    ·PÁÂ!!!¦³¦¨¥\¤F ·P¿E¤£ºÉ

TOP

        ÀR«ä¦Û¦b : ¶¢¤HµL¼Ö½ì¡A¦£¤HµL¬O«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD