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

[µo°Ý] ½Ð°ÝVBA¥i¥H°µ¨ì¨âÀɮפñ¹ï«á¦A²£¥Í¥t¤@Àɮתº¤ñ¹ïµ²ªG¶Ü?

¦^´_ 35# stillfish00


    HELLO~~~SORRY~~~­è­è¼g¿ù¤F~~~

¥Ø«e¬O"F"Äæ»P"M"Äæ,¦]¬°¸ê®Æ¶q¤ñ¸û¦h ©Ò¥H³£·|©Ô¨ìÄæ¼e250¥ª¥k~

TOP

¦^´_ 35# stillfish00


   HELLO~stillfish00

¥Ø«e¬O"K"Äæ»P"M"Äæ,¦]¬°¸ê®Æ¶q¤ñ¸û¦h ©Ò¥H³£·|©Ô¨ìÄæ¼e250¥ª¥k~

TOP

¦^´_ 33# happycoccolin
­Y¬O²£¥ÍªºÀɮר䤤¤@Äæ¦ì¤Ó¼e¤j¥i¥H¥ÎVBA³B²zÅý¥L³Ì¤j¥u¨ìÄæ¼e50(¨Ã¦Û°Ê´«¦C)

§A«üªº¹ï¶H¬O«ü¦Û°Ê½Õ¾ãÄæ¼e«áªº©Ò¦³Äæ³£Àˬd¡AÁÙ¬O¥u­n³æ¤@Äæ(­þ¤@Äæ?)

TOP

¦^´_ 32# stillfish00


    «¢Åo¡ãstillfish00

§Úª¾¹D¤F¡@¤U¦¸·|ª`·N¡@·PÁ¤j¤jªº­@¤ß¸Ñµª

TOP

¦^´_ 32# stillfish00


    «¢Åo~~stillfish00

¤]¤Ó§Ö³t¤F~~©êºp¦£¤¤¦³¿ù~½m²ßªºÀɮפӦh·d²V¤F~

·PÁÂÀ°¦£¸Ñµª~~~

¦A°Ý¤@­Ó°ÝÃD

¤@¹ï¦h­«½Æªº¸ê®Æ¤¤¬O§_¥i¥H¥u¨ú¤£­«½Æªº¨Ã¦b¦P¤@Äæ¦ì¤º°µ´«¦æ°Ê§@©O?

ÁÙ¦³­Y¬O²£¥ÍªºÀɮר䤤¤@Äæ¦ì¤Ó¼e¤j¥i¥H¥ÎVBA³B²zÅý¥L³Ì¤j¥u¨ìÄæ¼e50(¨Ã¦Û°Ê´«¦C)³o¤@Ãþªº³]©w¶Ü?

©êºp¤p©f³oªì¾ÇªÌ°Ýªº°ÝÃD³£«Ü²ö¦W¨ä§® ¤]ÁÂÁ§A­Ì¯à°÷­@¤ß¸Ñµª

¦A¦¸ÁÂÁÂÁÂÁ¡ã~~~~

TOP

¦^´_ 31# happycoccolin
¤W¶Çªº¨Ò¤l¡AºÉ¶q«O¯d­ì¥»¸ê®Æªº¯S©Ê(¦p:¬O§_§t¼ÐÀY¡B¬O§_¦³ªÅ¥Õ¡B¬O§_·|¦³­«½Æ¶µµ¥µ¥)¡A¤~·|¤ñ¸û²Å¦X¹ê»Ú·Q­nªºµ²ªG¡C
  1. Sub TEST()
  2.   Const DATABASE_NAME = "A" '¸ê®Æ®w¤u§@ªí¦WºÙ
  3.   Const DATABASE_COL = 5  'EÄæ
  4.   Const COMPARE_COL = 11  'KÄæ
  5.   
  6.   Dim d, ar, filein, fileout, s As String, i As Long
  7.   
  8.   Set d = CreateObject("scripting.dictionary")
  9.   With Sheets(DATABASE_NAME)
  10.     ar = .[A1].CurrentRegion.Resize(.Cells(.Rows.Count, "A").End(xlUp).Row).Value
  11.   End With
  12.   For i = 2 To UBound(ar)
  13.     s = Replace(ar(i, DATABASE_COL), "-", "")
  14.     If s <> "" Then
  15.       If d.exists(s) Then
  16.         d(s) = d(s) & "," & ar(i, 1)
  17.       Else
  18.         d(s) = ar(i, 1)
  19.       End If
  20.     End If
  21.   Next
  22.   
  23.   filein = Application.GetOpenFilename(FileFilter:="Excel ¬¡­¶Ã¯ (*.xlsx),*.xlsx", Title:="¿ï¾Ü­n¤ñ¹ïªºÀÉ®×")
  24.   If Not TypeName(filein) = "String" Then Exit Sub '¨ú®ø«hµ²§ô
  25.       
  26.   Application.ScreenUpdating = False
  27.   With Workbooks.Open(filein).Sheets(1)
  28.     ar = .[A1].CurrentRegion.Resize(.Cells(.Rows.Count, "A").End(xlUp).Row).Value
  29.     .Parent.Close False
  30.   End With
  31.   Application.ScreenUpdating = True
  32.   
  33.   ReDim Preserve ar(LBound(ar) To UBound(ar), LBound(ar, 2) To UBound(ar, 2) + 1)
  34.   For i = LBound(ar) + 1 To UBound(ar)
  35.     If ar(i, COMPARE_COL) <> "" Then
  36.       s = Replace(ar(i, COMPARE_COL), "-", "")
  37.       If d.exists(s) Then
  38.         ar(i, UBound(ar, 2)) = d(s)
  39.       Else
  40.         ar(i, UBound(ar, 2)) = "No Data"
  41.       End If
  42.     End If
  43.   Next
  44.   
  45.   With Workbooks.Add
  46.     Application.ScreenUpdating = False
  47.     With .Sheets(1).[A1].Resize(UBound(ar), UBound(ar, 2))
  48.       .Value = ar
  49.       .Font.Name = "Verdana"  '¦rÅé¦WºÙ
  50.       .Font.Size = 14 '¦rÅé¤j¤p
  51.       .Borders.LineStyle = xlContinuous '®Ø½u
  52.       .EntireColumn.AutoFit '½Õ¾ãÄæ¼e
  53.       
  54.       .Rows(1).Interior.Color = 12567966  '¼ÐÀYÃC¦â
  55.       .Rows(1).Font.Bold = True  '¼ÐÀY²ÊÅé¦r
  56.     End With
  57.     Application.ScreenUpdating = True
  58.    
  59.     If MsgBox("¬O§_­nÀx¦sÀÉ®×?", vbYesNo) = vbYes Then
  60.       fileout = Application.GetSaveAsFilename(FileFilter:="Excel ¬¡­¶Ã¯ (*.xlsx),*.xlsx", Title:="¥t¦s¬°·sÀÉ")
  61.       If Not TypeName(fileout) = "String" Then Exit Sub '¨ú®ø«hµ²§ô
  62.       .SaveAs fileout, FileFormat:=xlWorkbookDefault
  63.     End If
  64.   End With
  65. End Sub
½Æ»s¥N½X

TOP

¦^´_ 30# stillfish00


    «¢Åo~stillfish00

¤Ó´Î¤F~~^^ ¤Ó·P®¦~

¥u¬OÁÙ¦³¨â­Ó¤p°ÝÃD~
1.¥Ø«e­Y¬OªÅ¥ÕªºÄæ¦ì¥L¤]·|°µ§PÂ_

­YB.xlsxªº"K"Äæ¬OªÅ¥Õªº

¥L·|¥hŪ¨ú¸ê®Æ®wªº"E"ÄæªÅ¥Õ¦ì¸m²Ä¤@­Óªº¹ïÀ³­È ¼g¦b·sÀɮ׸̭± ¦ý¬O¨ä¹ê¨ºÄæÀ³¸Ó­n¬OªÅ¥Õ

2.­Y¬O¸ê®Æ®wªº"E"Äæ¦ì ¦P®É¦b"A"Äæ¦ì¦³¨âµ§¥H¤W¹ïÀ³ ¨º«ç»ò¤ñ¹ï¥X¨Ó?
   ¥Ø«e¸òVLOOKUP¤@¼Ë¥u¯à¤@¹ï¤@ VBA¥i°µ¥X¤@¹ï¦h¶Ü?

   ¦Ó¥»¦¸¤ñ¹ïµ²ªG¥X¨Ó¤£¬O¹ïÀ³¨ì²Ä¤@µ§ ¦Ó¬OªÅ¥Õ¦æ«áªº²Ä¤@µ§(½Ð¨£ªþÀÉBook21.xlsx)

ABC_0802.zip (30.5 KB)


ÁÂÁÂÁÂÁÂ!!!!«ùÄò¬ãŪ¤¤

TOP

¦^´_ 29# happycoccolin
  1. Sub TEST()
  2.   Const DATABASE_NAME = "A" '¸ê®Æ®w¤u§@ªí¦WºÙ
  3.   Const DATABASE_COL = 5  'EÄæ
  4.   Const COMPARE_COL = 11  'KÄæ
  5.   
  6.   Dim d, ar, filein, fileout, s, i As Long
  7.   
  8.   Set d = CreateObject("scripting.dictionary")
  9.   With Sheets(DATABASE_NAME)
  10.     ar = .[A1].CurrentRegion.Resize(.Cells(.Rows.Count, "A").End(xlUp).Row).Value
  11.   End With
  12.   For i = 2 To UBound(ar)
  13.     d(Replace(ar(i, DATABASE_COL), "-", "")) = ar(i, 1)
  14.   Next
  15.   
  16.   filein = Application.GetOpenFilename(FileFilter:="Excel ¬¡­¶Ã¯ (*.xlsx),*.xlsx", Title:="¿ï¾Ü­n¤ñ¹ïªºÀÉ®×")
  17.   If Not TypeName(filein) = "String" Then Exit Sub '¨ú®ø«hµ²§ô
  18.       
  19.   Application.ScreenUpdating = False
  20.   With Workbooks.Open(filein).Sheets(1)
  21.     ar = .[A1].CurrentRegion.Resize(.Cells(.Rows.Count, "A").End(xlUp).Row).Value
  22.     .Parent.Close False
  23.   End With
  24.   Application.ScreenUpdating = True
  25.   
  26.   ReDim Preserve ar(LBound(ar) To UBound(ar), LBound(ar, 2) To UBound(ar, 2) + 1)
  27.   For i = LBound(ar) + 1 To UBound(ar)
  28.     s = Replace(ar(i, COMPARE_COL), "-", "")
  29.     If d.exists(s) Then
  30.       ar(i, UBound(ar, 2)) = d(s)
  31.     Else
  32.       ar(i, UBound(ar, 2)) = "No Data"
  33.     End If
  34.   Next
  35.   
  36.   With Workbooks.Add
  37.     Application.ScreenUpdating = False
  38.     With .Sheets(1).[A1].Resize(UBound(ar), UBound(ar, 2))
  39.       .Value = ar
  40.       .Font.Name = "Verdana"  '¦rÅé¦WºÙ
  41.       .Font.Size = 14 '¦rÅé¤j¤p
  42.       .Borders.LineStyle = xlContinuous '®Ø½u
  43.       .EntireColumn.AutoFit '½Õ¾ãÄæ¼e
  44.       
  45.       .Rows(1).Interior.Color = 12567966  '¼ÐÀYÃC¦â
  46.       .Rows(1).Font.Bold = True  '¼ÐÀY²ÊÅé¦r
  47.     End With
  48.     Application.ScreenUpdating = True
  49.    
  50.     If MsgBox("¬O§_­nÀx¦sÀÉ®×?", vbYesNo) = vbYes Then
  51.       fileout = Application.GetSaveAsFilename(FileFilter:="Excel ¬¡­¶Ã¯ (*.xlsx),*.xlsx", Title:="¥t¦s¬°·sÀÉ")
  52.       If Not TypeName(fileout) = "String" Then Exit Sub '¨ú®ø«hµ²§ô
  53.       .SaveAs fileout, FileFormat:=xlWorkbookDefault
  54.     End If
  55.   End With
  56. End Sub
½Æ»s¥N½X

TOP

¦^´_ 27# stillfish00


    «¢Åo~~stillfish00 ~~^^

­è­è¸Õ¹LOK~

¦ý¬O¦³´X­Ó°ÝÃD

1.­Y¸ê®Æ®w¤¤¦³ªÅ¥Õ¦æ,´N·|°±¤î¤ñ¹ï ¾É­PB.xlsx³Ì«á¤@­Ó»P¸ê®Æ®w¹ïÀ³ªºÄæ¦ì¤U¤@¦æ¬ÒÅܦ¨NO DATA
(¥Ø«e¸ê®Æ®w¹w­p¦³50000¦æ¥ª¥kªº¸ê®Æ) ­è­è¦³¥ý©ñ¶i¥h¤ñ¹ïµo²{µ²ªG³q³q³£¬ONO DATA

ABC_0801.zip (30.21 KB)

2.¬O§_¥i¥HÅýuser¿ï¾Ü¦sÀÉ»P§_ ¤£­nª½±µ¥ý¸õ¥X¦sÀɪºµøµ¡©O?
p.s.¥Ø«eÀx¦sªºÀɮ׬O¨S¦³ÀÉ®×Ãþ«¬ªº

3.¬O§_¥iÅý¤ñ¹ï¦nªºÀɮ׸ê®Æ¦³®æ½u¤Î¦Û°Ê½Õ¾ãÄæ¼e?¥i³]©w¦r«¬»P¤j¤p¶Ü?


©êºp°ÝÃD«Ü¦h~«ô°U«ô°U~~~~~~~

TOP

¦^´_ 27# stillfish00


    ÁÂÁÂstillfish00~~~~

§Ú¨Órun¤@¤U~·P®¦±zªºÀ°¦£~~

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD