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

[µo°Ý] vlookup§ì¨ú

[µo°Ý] vlookup§ì¨ú

=IFERROR(VLOOKUP($C2,'\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\AL¨C¤ë¥Ø¼Ð\[AL-202306¥Ø¼Ð.xlsx]6¤ë (SAAM&FAAM)'!$B:$G,4,0),"")

¦³¿ìªk§¹¦¨¤U­±¨â­Ó±ø¥ó¶Ü??
202306->§ì¨úO3³æ¤¸®æ
6¤ëªº"6"->§ì¨úO4³æ¤¸®æ

©³¤U¬O§Úªº¼gªk¡A¦ý¬O¨S¦³§ì¨ì¥ô¦ó¸ê®Æ
=IFERROR(VLOOKUP($C2,'"\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\AL¨C¤ë¥Ø¼Ð\[AL-"&O3&"¥Ø¼Ð.xlsx]"&O4&"¤ë (SAAM&FAAM)"'!$B:$G,4,0),"")

¦^´_ 1# cowww

¦P¨Æµ¹¤F§Ú¤@¬q»yªk¡A«o¥X²{¤F§ó·s¬¡­¶Ã¯³sµ²
½Ð°Ý³o¬O«ç»ò¤@¦^¨Æ??
AL³Ì¤j¤ë¥÷.PNG

Sub «ö¶s4_Click()

'­pºâ¿ï¶µ§ï¬°¦Û°Ê
Application.Calculation = xlCalculationAutomatic

'Ãö³¬´£¥Ü
Application.DisplayAlerts = False

    Dim formulaCell As Range
    Dim workbook_name As String
    Dim worksheet_name As String

    ' ³]¸m¨ç¼Æ¤½¦¡¦b³æ¤¸®æO2
    Set formulaCell = Worksheets("¤½¦¡(¤Å§R)").Range("O2")

    ' Àò¨ú­n©ñ¤J¤½¦¡ªºkey¡]key¦bC2Àò¨ú¡^
    Dim lookup_value As String
    lookup_value = "$C2"

    ' Àò¨ú "AL-202307¥Ø¼Ð.xlsx" ©M "7¤ë (SAAM&FAAM)"¡A¤À§O¦b³æ¤¸®æ P3 ©M P4 Àò¨ú
    workbook_name = Worksheets("¤½¦¡(¤Å§R)").Range("P3").Value
    worksheet_name = Worksheets("¤½¦¡(¤Å§R)").Range("P4").Value

    ' Ì۫ؤ½¦¡¦r²Å¦ê¡A¦}¨Ï¥Î¨â­ÓÂù¤Þ¸¹¶i¦æÂà´«
    Dim formula As String
    formula = "=IFERROR(VLOOKUP(" & lookup_value & ", '" & workbook_name & "'!" & "$B:$G, 4, 0), """")"

    ' ±N¤½¦¡©ñ¤J¤½¦¡³æ¤¸®æ O2
    formulaCell.formula = formula

    ' Ãö³¬¥´¶}ªº¤u§@ï
    Dim wb As Workbook
    Set wb = Workbooks.Open("\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\AL¨C¤ë¥Ø¼Ð\" & workbook_name, UpdateLinks:=False)
    wb.Close SaveChanges:=False

'¶}±Ò´£¥Ü
    Application.DisplayAlerts = True
   
End Sub

TOP

§ï¦¨³o¼Ë¬Ý¬Ý

=IFERROR(VLOOKUP($C2,

INDIRECT("'\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\AL¨C¤ë¥Ø¼Ð\[AL-" & O3 & "¥Ø¼Ð.xlsx]" & O4 & "¤ë (SAAM&FAAM)'!$B:$G")

,4,0),"")
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 3# ML089

«D±`·PÁÂML089¤j¤jªº¸Ñ´b

¦ý¬O³o¬q¨ç¼Æ¤½¦¡¨S¦³¥ô¦ó­È¥X¨Ó

C2.PNG

TOP

¦^´_ 4# cowww

¦b½s¿è¦C¡A¨Ï¥ÎF9¥h±Æ¬d¨C¬q¤½¦¡¸Ìªº°Ñ¼Æ©Î­È¬O­þ¸Ì¦³°ÝÃD
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 5# ML089

«D±`·PÁÂML089¤j¤jªº¸Ñ´b

¦ý¬O«ö¤UF9¤§«á¤½¦¡®ø¥¢¡A¤]¨S¦³¼Æ­È¶]¥X¨Ó

TOP

¦^´_ 6# cowww

INDIRECT("'\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\AL¨C¤ë¥Ø¼Ð\[AL-" & O3 & "¥Ø¼Ð.xlsx]" & O4 & "¤ë (SAAM&FAAM)'!$B:$G")

    §A­n¥ý¿ï¨ú "'\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\AL¨C¤ë¥Ø¼Ð\[AL-" & O3 & "¥Ø¼Ð.xlsx]" & O4 & "¤ë (SAAM&FAAM)'!$B:$G"
    «öF9¡A¬Ý¥X²{ªº¤å¦r¬O§_§A­nªºÀx¦s®æ¦ì¸m
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦p¤U¥u¬O¥Ü¨Ò//¦Û¤v®M¥Î¬Ý¬Ý

Fx$ = "=IFERROR(VLOOKUP($C2,'\\shl-group.com\dept\MFMG\B.¦U²Õ¸ê®Æ (Team inform)\E.¥ÍºÞ²Õ (PPC group)\X.¦Û°Ê¤Æ¤u¨ã(¤Å§R)\AL¨C¤ë¥Ø¼Ð\[AL-xYM¥Ø¼Ð.xlsx]xMon¤ë (SAAM&FAAM)'!$B:$G,4,0),"""")"

¦~¤ë$="202306"  --«ü©wÀx¦s®æ
¤ë¥÷$="6"  --«ü©wÀx¦s®æ

Fx=replace(replace(Fx, "xYM", ¦~¤ë), "xMon", ¤ë¥÷)

formulacell.formual = Fx

TOP

¦^´_ 7# ML089


«D±`·PÁÂML089¤j¤jªº¸Ñ´b

«ö¤UF9½T¹ê"O3"&"O4"¦³Åܦ¨§Ú·Q­nªº¼Æ¦r
¦ý¬O¬°¦ó·|¨S§ì¨ìÀÉ®×ùØ­±ªº¼Æ¦r©O??

TOP

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

«D±`·PÁ­㴣³¡ªL¤j¤jªº¸Ñ´b
«Ü½ÆÂøªº¤½¦¡
¬Ý¤£À´¡A¤p§Ì»Ý­n®É¶¡¬ã¨s

TOP

        ÀR«ä¦Û¦b : ¦¨¥\¬OÀuÂIªºµo´§¡A¥¢±Ñ¬O¯ÊÂIªº²Ö¿n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD