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

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

¥»©«³Ì«á¥Ñ 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

¦^´_ 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

¦^´_ 44# stillfish00


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

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

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

¦^´_ 42# stillfish00

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

TOP

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

TOP

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

TOP

¦^´_ 37# stillfish00


   Ãö©óÂIÀ»«ö¶s«á½Æ»sªº¸ê®Æ¨Ã¤£¬O¦b·í«eªºSHEET,¤@ª½§ì¨ú¨ì¥t¤@­Ósheet
  ­è­è»¡§â¤À­¶½Æ»s¨ì­Ó§O«È¤á©ú²Ó,¦³¦¨¥\§ì¨ú¹ïªº¸ê®Æ
¦ý¤§«á¦A¶}±Ò¥L¤S¬O§ì¨ì§OSHEETªº¸ê®Æ¤F...

TOP

¦^´_ 37# stillfish00


   «á¨Ó§Ú±N¦h­Ó»Ý­n°Ñ·Óªº¤u§@ªí²¾°Ê¨ì[½d¨Ò-´¡¤J¶W³sµ²],°õ¦æ«ö¶s´N¥i¥H¥¿½TŪ¨ú¸ê®Æ¤F,
¦ý·Q½Ð°Ý«ç»òÅý¥L¥i¥H¶K¤W³sµ²¦Ó¤£¬O¶K¤W­È©O?

¤W¤@­Ó¥¨¶°¥i¥H¶K¤W³sµ²
¤£ª¾¸Ó«ç»ò§ó´«¼gªk®M¤J§Aªº¥¨¶°,Åý¥L¶K¤Wªº®É­Ô¥i¥H¶K¤W³sµ²
  1. Sub ¶K¤W¸ê®Æ¦Ü_·~°ÈºÞ²z()
  2. '
  3. ' ¶K¤W¸ê®Æ¦Ü_·~°ÈºÞ²z ¥¨¶°
  4. '
  5.   
  6.     Range("A3:P3").Copy
  7.     Windows("«È¤á©ú²Ó-·~°È±M¥Î.xlsm").Activate
  8.     EndRow = Windows("«È¤á©ú²Ó-·~°È±M¥Î.xlsm").ActiveSheet.Range(Cells(Rows.Count, "A").End(xlUp).Address).Row + 1  '©Ò¦³¨Ï¥Î¤¤ªº¦C¼Æ+1
  9.     Windows("«È¤á©ú²Ó-·~°È±M¥Î.xlsm").ActiveSheet.Cells(EndRow, "A").PasteSpecial Paste:=xlPasteValues '¥Ø«e¨Ï¥Î¤¤ªº¤À­¶,ªº³Ì¤U¤èªÅ¥Õ¦C¶K¤W­È
  10.     ActiveSheet.Paste Link:=True
  11.     Application.CutCopyMode = False
  12.     ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=ThisWorkbook.Path & "\" & ThisWorkbook.Name

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

TOP

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

¦^´_ 37# stillfish00


  ±N§A´£¨Ñªº¥¨¶°«ü¥O¶ñ¼g¨ì¥t¤@­Ó§t¦h­Ó¤u§@­¶ªº­Ó§O«È¤á©ú²Ó¤º,(¸Ì­±¦P¼Ë¦³¤@­Ó¦¬´Ú¸ò¶Ê¤@¼Ò¤@¼Ëªº)
¥t¦¹¦¬´Ú¸ò¶Êªº¸ê®Æ¬O¥Î³sµ²¨ú¨ì¥XÀ\³æ¤ºªº¸ê®Æ,¦n¹³¶K¨ì·~°È©ú²Ó¤º¦pªG¦b²Ä2­Ó¥L³sµ²·|¤@ª½ÅÜ°Ê, ,©Ò¥H¤~¥[¤W³sµ²,
¥t¥i¥H¶K¤W³sµ²»P¶W³sµ²¶Ü? ­nÅý·~°È©ú²Ó¤ºªº¸ê®Æ¦P¨B¸òµÛ­Ó§O«È¤á©ú²Ó§ó·s

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD