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

[µo°Ý] Ãö©ó¦Û°Ê¶K¤W³sµ²¦Ü¥t¤@­ÓÀɮרæ۰ʴ¡¤J¶W³sµ²

¦^´_ 40# starry1314
¦n¹³§ä¨ì­þÃ䦳°ÝÃD¤F,¦pªG­Ó§O«È¤á©ú²Óªº¸ê®Æ¬O¥Î³sµ²¨ì¥t¤@­ÓSHEETªº¸Ü,¥L´N¬O½Æ»s¤½¦¡¹L¥h©Ò¥HÅܱo©Ç©Çªº

TOP

¦^´_ 41# starry1314
¦A¤W¶ÇÀɮ׬ݬÝ
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¥»©«³Ì«á¥Ñ starry1314 ©ó 2015-5-7 14:22 ½s¿è

¦^´_ 42# stillfish00

¦A³Â·Ð¤F
  
½d¨Ò-¦Û°Ê´¡¤J¶W³sµ².rar (260.59 KB)

TOP

¦^´_ 43# starry1314
­×§ï¦p¤U
  1. Sub ¶K¤W¸ê®Æ¦Ü_·~°ÈºÞ²zTEST¦Û°Ê©¹¤U¶K¤@¦æ()
  2. '
  3. ' ¶K¤W¸ê®Æ¦Ü_·~°ÈºÞ²z ¥¨¶°
  4. '
  5.     Dim lSourceRow As Long, lTargetRow As Long
  6.     Dim wsTarget As Worksheet
  7.    
  8.     With ActiveSheet
  9.         lSourceRow = .Buttons(Application.Caller).TopLeftCell.Row   '³QÂIÀ»ªº¸Ó«ö¶s¦æ¼Æ
  10.         If .Cells(lSourceRow, "B").Text = vbNullString Then MsgBox "¤é´ÁÄæµL¸ê®Æ¡AµLªk§PÂ_¶K¤W¤ë¥÷": Exit Sub
  11.         Set wsTarget = Workbooks("«È¤á©ú²Ó-·~°È±M¥Î.xlsm").Sheets(GetMonthStr(.Cells(lSourceRow, "B"))) '¤é´Á§PÂ_­n¶K¤Wªº¤u§@ªí
  12.         lTargetRow = wsTarget.Cells(Rows.Count, "B").End(xlUp).Row + 1  '­n¶K¤Wªº¦ì¸m
  13.         Application.ScreenUpdating = False
  14.         .Range(.Cells(lSourceRow, "A"), .Cells(lSourceRow, "P")).Copy
  15.         wsTarget.Cells(lTargetRow, "B").PasteSpecial Paste:=xlPasteValues
  16.         wsTarget.Paste Link:=True
  17.         Application.ScreenUpdating = True
  18.     End With
  19.    
  20.     'RÄæ³]©w¶W³sµ²¨ì¥»ÀÉ®×
  21.     With wsTarget
  22.         .Hyperlinks.Add Anchor:=.Cells(lTargetRow, "R"), _
  23.                         Address:=ThisWorkbook.FullName, _
  24.                         SubAddress:=ThisWorkbook.ActiveSheet.Name & "!" & Rows(lSourceRow).Address, _
  25.                         TextToDisplay:=ThisWorkbook.FullName
  26.         .Cells(lTargetRow, "R").HorizontalAlignment = xlLeft
  27.     End With
  28. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 44# stillfish00


    ·PÁÂÀ°¦£~­ì¨Ó¬O³o¼Ë²K¥[...·Q¨ìÀY³£µh¤F¡I

TOP

¦^´_ 9# lpk187


    ¤£¦n·N«ä~·Q½Ð°Ý¤@¤U
ActiveSheet.Name Ū¨ú¥Ø«e¤u§@ªí¦WºÙ
­n«ç»ò®M¥Î¶i¤U¦C«ü¥O©O?¦]¥u­n§ïÀɦWªº¸Ü,¥L´N§ä¤£¨ì¦^¨Óªºµøµ¡....
Windows("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Activate
  1. Sub ¤pÀ\³æ_SÀ\_¦Û°Ê¿é¤J¸ê®Æ()
  2. '
  3. ' ¤pÀ\³æ_¦Û°Ê¿é¤J¸ê®Æ ¥¨¶°
  4. '

  5. '
  6.     Sheets("¼Æ¾Ú").Select
  7.     Range("B25").Select
  8.     Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
  9.     Sheets("§Ö³t¿é¤J").Select
  10.     Windows("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Activate
  11.     Sheets("¥XÀ\³æ").Select
  12.     Range("H1:I1").Select
  13.     Selection.Copy
  14.     Windows("¤pÀ\³æ-S.xlsm").Activate
  15.     Range("B2").Select
  16.     ActiveSheet.Paste Link:=True
  17.     Windows("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Activate
  18.     Range("C4:AI4").Select
  19.     Application.CutCopyMode = False
  20.     Selection.Copy
  21.     Windows("¤pÀ\³æ-S.xlsm").Activate
  22.     Range("C3").Select
  23.     ActiveSheet.Paste Link:=True
  24.     Windows("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Activate
  25.     Range("V1:X1").Select
  26.     Application.CutCopyMode = False
  27.     Selection.Copy
  28.     Windows("¤pÀ\³æ-S.xlsm").Activate
  29.     Range("D3").Select
  30.     ActiveSheet.Paste Link:=True
  31.     Windows("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Activate
  32.     Range("X3:AI3").Select
  33.     Application.CutCopyMode = False
  34.     Selection.Copy
  35.     Windows("¤pÀ\³æ-S.xlsm").Activate
  36.     Range("B4").Select
  37.     ActiveSheet.Paste Link:=True
  38.     Windows("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Activate
  39.     Range("E1:F1").Select
  40.     Application.CutCopyMode = False
  41.     Selection.Copy
  42.     Windows("¤pÀ\³æ-S.xlsm").Activate
  43.     Range("B5").Select
  44.     ActiveSheet.Paste Link:=True
  45.     Windows("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Activate
  46.     End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-5-10 17:24 ½s¿è

¦^´_ 46# starry1314


    ¤W­±stillfish00¤j¤jªºµ{¦¡¤¤´N¦³©ú¥Üªº¼g¤JŪ¨ú"¥»Àɪº¸ô®|¥[ÀɮצWºÙ==>"ThisWorkbook.FullName
¥H¤Î¥Ø«e"°µ¥Î¤¤ªº¤u§@ªí¦WºÙ"==>ThisWorkbook.ActiveSheet.Name
¥Lªºµ{¦¡§A­Y¦³¥ÎF8¤@¨B¤@¨B°õ¦æ¡A¦A¥Î°Ï°ìÅܼƵøµ¡¥hÆ[¹î¡A¤£À´ªº¦b»¡©úF1¤¤³£¦³«Ü©ú½Tªº»¡©ú¡A§A·|¾Ç¨ì«Ü¦hªF¦è¡A¹³ThisWorkbook.FullName³o¥y¡A§Ú¤]¬O±qstillfish00¤j¤jµ{¦¡¤¤¾Çªº
¥H§APOªº³o­Óµ{¦¡½X¬O§Q¥Î¿ý»sªº°Ê§@¼g¦¨ªº¡A¨ä¹ê¥u­n§A¤F¸Ñ¤F±q­þ¸Ì¨Ó"ThisWorkbook.FullName"µM«á¥h­þ¸Ì¡A«Ü¦h¤£¥Î¼gªº¹³¿ý»sªºµ{¦¡½X¨º»òªº·ÐÂøªº

1.¥H¤U­±³o¥y¨Ó»¡
Windows("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Activate
Sheets("¥XÀ\³æ").Select
Range("H1:I1").Select
Selection.Copy
¥i¥H§âSelect¡BActivate©MSelection®³¨«¼g¦¨  Workbooks("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Sheets("¥XÀ\³æ").Range("H1:I1").Copy  <<<==³o¬O¨Ó·½¦a¤è

2.¤U­±³o¥y«h¬O¥Øªº¦a¤è
Windows("¤pÀ\³æ-S.xlsm").Activate
Range("B2").Select
ActiveSheet.Paste Link:=True¡A¦]¬°³o¸Ì§A¬O¥ÎActiveSheet©Ò¥H§Ú¨Ã¤£ª¾¹D¤u§@ªí¦W¬O¤°»ò©Ò¥H°²³]¬O Sheets("¤pÀ\³æ")

¥i¥H¼g¦¨  Workbooks("¤pÀ\³æ-S.xlsm").Sheets("¤pÀ\³æ").Range("B2")
§â¨Ó·½©M¥Øªº¼g¦b¤@°_¬O
Workbooks("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Sheets("¥XÀ\³æ").Range("H1:I1").Copy Workbooks("¤pÀ\³æ-S.xlsm").Sheets("¤pÀ\³æ").Range("B2")
­Y¬O¥ÎÅܼƩO¡H
¥u¯àª¾¹D¥Ø«eµ{¦¡½Xªº©Ò¦bÀɮפ]´N¬OThisWorkbook©M¥Ø«e§@¥Î¤¤ªº¤u§@ªíActiveSheetÅܼƦp¤U¡G

¸ô®|ÀɦW=ThisWorkbook.FullName <<<³o­Ó¬OŪ¨ú¸ô®|©MÀɦWªº
ÀɦW=ThisWorkbook.Name  <<<<³o­Ó¥u¦³Åª¨úÀɦW¡A³o©M¤W­±ªº¥Î³~¤£¦P
¤u§@ªí¦W=ThisWorkbook.ActiveSheet.Name

§Ú¦b¥ÎÅܼƨӳB²z³o¬q Workbooks("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Sheets("¥XÀ\³æ").Range("H1:I1").Copy Workbooks("¤pÀ\³æ-S.xlsm").Sheets("¤pÀ\³æ").Range("B2")
´N¥i¥H¼g¦¨ Workbooks(ÀɦW).Sheets(¤u§@ªí¦W).Range("H1:I1").Copy Workbooks("¤pÀ\³æ-S.xlsm").Sheets("¤pÀ\³æ").Range("B2")
¬Æ¦Ü§Ú¥u­n§âWorkbooks("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Sheets("¥XÀ\³æ").Range("H1:I1")ªº­È¥Iµ¹ Workbooks("¤pÀ\³æ-S.xlsm").Sheets("¤pÀ\³æ").Range("B2:??")<<³o¸Ìªº??§Ú°²³]¬OC2

¥i¥H¼g¦¨ Workbooks("¤pÀ\³æ-S.xlsm").Sheets("¤pÀ\³æ").Range("B2:C2")=Workbooks("¥XÀ\³æ(½Ð¥ý¥t¦s·sÀÉ).xlsm").Sheets("¥XÀ\³æ").Range("H1:I1").Value

¤W­±³o2¥yªº¤£¦P¬O   ¨Ó·½.copy  ¥Øªº
                    ¥Øªº = ¨Ó·½ (¨Ó·½¦³2­Ó¥H¤WÀx¦s®æ¥²¶·¥[¤W.Value)

³o¼Ë¼gªº¸Ü¤£¥ÎActivate¨ÓActivate¥hªº¡A°õ¦æªº³t«×¤]·|¤ñ¸û§Ö¡A«eÃD¬O2­ÓÀɮ׶·¦P®É¶}µÛ

TOP

¦^´_ 46# starry1314

¦A¥Hstillfish00¤j¤jªºµ{¦¡¨Ó»¡©úThisWorkbook.FullNameªº¸É¥R

    With wsTarget
        .Hyperlinks.Add Anchor:=.Cells(lTargetRow, "R"), _
                        Address:=ThisWorkbook.FullName, _
                        SubAddress:=ThisWorkbook.ActiveSheet.Name & "!" & Rows(lSourceRow).Address, _
                        TextToDisplay:=ThisWorkbook.FullName
        .Cells(lTargetRow, "R").HorizontalAlignment = xlLeft
    End With
¤W­±µ{¦¡¤¤ªº Address:=ThisWorkbook.FullName ªº¥Î³~©M¤W½gªº ThisWorkbook.Name ¥Î³~¤£¤@¼Ëªº¦a¤è
Address¥²¶·«ü¥X©ú½Tªº¸ô®|¡A©Ò¥H¥²¶·¨Ï¥Î ThisWorkbook.FullName
­Y¬O¨Ï¥Î ThisWorkbook.Name «h¥²¶·¥[«e­±¥[¤W¸ô®| ¡A¨Ò¦p"D:\¸ê®Æ§¨\" & ThisWorkbook.Name

TOP

¦^´_ 47# lpk187

¥Ø«e§Ú§ï¼g¦¨³o¼Ë...¦ý­n«ç»òÅý¥L¶K¤Wªº¬O³sµ²©O?
¥Ø«e°µªk¬O³Ì«á¦b¥[¤W«ü¥OÅý§Ú»Ý­nªº³sµ²¹L¨Ó....

¬Ý¤Fstillfish00¤j¤jµoªº ­×§ï«e29F¡÷¶K¤W­È
                                           ­×§ï«á44F¡÷¶K¤W³sµ².
®t²§¦³ÂI¤j.....¬Ý±oÀ´·N«ä¡A¦ý­n¦Û¤vÅÜ´«´N¤@ÀYÃú¤ô¤F[code]Sub ¤pÀ\³æ_SÀ\_¦Û°Ê¿é¤J¸ê®Æ()
'
' ¤pÀ\³æ_SÀ\_¦Û°Ê¿é¤J¸ê®Æ ¥¨¶°
'

'
    Sheets("¼Æ¾Ú").Select
    Range("B25").Select
    Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
    Sheets("§Ö³t¿é¤J").Select
    Workbooks("¤pÀ\³æ-S.xlsx").Sheets("§Ö³t¿é¤J").Range("B2") = ThisWorkbook.Sheets("¥XÀ\³æ").Range("H1:I1").Value
    Workbooks("¤pÀ\³æ-S.xlsx").Sheets("§Ö³t¿é¤J").Range("C3") = ThisWorkbook.Sheets("¥XÀ\³æ").Range("C4:AI4").Value
    Workbooks("¤pÀ\³æ-S.xlsx").Sheets("§Ö³t¿é¤J").Range("D3") = ThisWorkbook.Sheets("¥XÀ\³æ").Range("V1:X1").Value
    Workbooks("¤pÀ\³æ-S.xlsx").Sheets("§Ö³t¿é¤J").Range("B4") = ThisWorkbook.Sheets("¥XÀ\³æ").Range("X3:AI3").Value
    Workbooks("¤pÀ\³æ-S.xlsx").Sheets("§Ö³t¿é¤J").Range("B5") = ThisWorkbook.Sheets("¥XÀ\³æ").Range("E1:F1").Value
   
   '´À´«­È¬°³sµ²
  ThisWorkbook.Sheets("¥XÀ\³æ").Activate
    Range("X3:AI3").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("¤pÀ\³æ-s.xlsx").Activate
    Range("B4").Select
    ActiveSheet.Paste Link:=True
   
    End Sub

TOP

¥»©«³Ì«á¥Ñ starry1314 ©ó 2015-5-11 00:59 ½s¿è

¦^´_ 47# lpk187


¥t·Q½Ð°Ý°Ï°ìÅܼƵøµ¡­n«ç»ò¬Ý©O?
¥´¶}«á«öF8³v¦æ´ú¸Õ
¹Bºâ¦¡  ­È   «¬ºA
¤£¤ÓÀ´«ç»ò§Q¥Î¥H¤W¤T¶µ¦Ó¨Ó¤F¸Ñ«ü¥Oªº·N¸q
¬O¥H¹Bºâ¦¡©Î«¬ºA¥h»¡©ú´M§ä¶Ü? ¥Î¹Bºâ¦¡§ä¤£¨ì,¥H§ÎºA¨º§ä¥X¨Óªº¤S¤£¤Ó·f

¹³wsTarget <³o¬O¦Û©w¸q¦WºÙ¶Ü?

TOP

        ÀR«ä¦Û¦b : ¡i¬°µ½Ävª§¡j¤H¥Í­n¬°µ½Ävª§¡A¤À¬í¥²ª§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD