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

[µo°Ý] «ü©wÀx¦s®æ¤å¦rÂà¤j¼g

[µo°Ý] «ü©wÀx¦s®æ¤å¦rÂà¤j¼g

¤u§@¤W±`»Ý­n¥Î¨ì±N­^¤å¦r¥þ³¡Âà¤j¼g©Î²Ä¤@­Ó¦rÂন¤j¼g,§Úª¾¹D¨ç¼Æ¤¤¥i¥H°µ¨ì,¦ý¤£ª¾¨Ï¥Î¥¨¶°¬O§_¤]¯à¼g¥X³o¼Ëªº®ÄªG?
§Úªº»Ý¨D¦p¤U,½Ð°ª¤H«üÂI!
a) µ{¦¡»P»Ý­nÂà¤j¼gªº¤å¥ó¬O¤À¶}ªº
b) ¤À¦¨¤G­Ó«ö¶s¥þ³¡Âà¤j¼g/²Ä¤@­Ó¦rÂন¤j¼g(¥\¯à¤À¶})
c) ¦b¥ô¤@¶}±ÒªºExcel¤å¥óªº¥ô¦ó¥H·Æ¹«ÂI¿ï«ü©wÀx¦s®æ(³æ¤@©Î°é¿ïªº½d³ò¨Ò:a5/b10/c8:c12)
d)«ö¤U"Âà´«¶s"«á,¦b«ü©wÀx¦s®æ±N¦rÅéÂন¤j¼g/²Ä¤@­Ó¦r¤j¼g,·íµM¥¼¿ï©wªºÀx¦s®æ¤£¯àÂà´«
e)¦]¬°¶}±Òªº¥i¯à¬O¥ô¦óªº¤å¥ó,¤£ª¾¦b¼gµ{¦¡ªº®É­Ô¼g±o¥X¨Ó¶Ü?
f)©ÎªÌ¦pªG¼gµ{¦¡¤@©w­n«ü©wÀɦW(§Ú¤£²M·¡¬O§_¦p¦¹),´N¦bÀɮפ¤«ü©w¤@­ÓÀɦWªº¦ì¸m(F1),¤£ª¾¬O§_¥i¦æ?
upper.zip (11.41 KB)

¦^´_ 1# PJChen
¨â«öÁä ªº¦@¦Pµ{¦¡½X
  1. Option Explicit
  2. Sub Ex()
  3.     Dim E As Range, Rng As Range
  4.     If TypeName(Selection) <> "Range" Then Exit Sub '¤£¬ORange(Àx¦s®æ)¤£©¹¤U°õ¦æµ{¦¡
  5.     If Selection.Count = 1 And Selection(1) = "" Then Exit Sub  '¿ï¾Ü1Àx¦s®æ¥B¬°ªÅ¥Õ®É¤£©¹¤U°õ¦æµ{¦¡
  6.     For Each E In Selection.SpecialCells(xlCellTypeConstants)
  7.         If InStr(Shapes(Application.Caller).OLEFormat.Object.Caption, "¥þ³¡¤j¼g") Then
  8.             E.Value = UCase(E)                          '¥þ³¡Âà´«¬°¤j¼g
  9.         Else
  10.             E.Value = UCase(Mid(E, 1, 1)) & LCase(Mid(E, 2))  'Âà´«²Ä1­Ó¦r¤¸¬°¤j¼g
  11.             '**: Mid(E, 1, 1)-> ±q²Ä1­Ó¦r¤¸°_Ū¤J¤@­Ó¦r¤¸ªº¦r¦ê
  12.             '**" Mid(E, 2) -> ±q²Ä2­Ó¦r¤¸°_Ū¤J¥þ³¡ªº¦r¦ê
  13.         End If
  14.     Next
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# GBKEE
½Ð°Ý:
§Ú±N³o­Óµ{¦¡°õ¦æ®É,µL½×¦b­ì¥¨¶°Àɮפ¤©Î¥t¤@­Ó´ú¸Õ"Test"Àɤ¤,³£¤£¯à°õ¦æ,½ÐÀ°§Ú¬Ý¬Ý°ÝÃD¥X¦b­þ?
¥t¥~³o­Óµ{¦¡
1) ¤G­Ó«ö¶s¥\¯à¤À¶}(¥þ³¡Âà¤j¼g/²Ä¤@­Ó¦rÂন¤j¼g)¬O§_¯à¤À¶}°õ¦æ?(¦]¬°°õ¦æµ²ªG¥Ø«e¬Ý¤£¥X¨Ó)
2) ¥i°w¹ï¥ô¦ó¶}±ÒªºExcel¤å¥ó°õ¦æ ¥þ³¡Âà¤j¼g/²Ä¤@­Ó¦rÂন¤j¼g ¥\¯à¶Ü?
Upper.zip (22.32 KB)

TOP

¤Þ¥ÎG¤j¤jªº¼gªk~ ¦Û¤v§ï¤@§ï´N¦n¤F~
  1. Sub uppera() '¥þ³¡¤j¼g
  2.     Dim E As Range, Rng As Range
  3.     If TypeName(Selection) <> "Range" Then Exit Sub '¤£¬ORange(Àx¦s®æ)¤£©¹¤U°õ¦æµ{¦¡
  4.     If Selection.Count = 1 And Selection(1) = "" Then Exit Sub  '¿ï¾Ü1Àx¦s®æ¥B¬°ªÅ¥Õ®É¤£©¹¤U°õ¦æµ{¦¡
  5.     For Each E In Selection.SpecialCells(xlCellTypeConstants)

  6.             E.Value = UCase(E)                          '¥þ³¡Âà´«¬°¤j¼g

  7.             '**: Mid(E, 1, 1)-> ±q²Ä1­Ó¦r¤¸°_Ū¤J¤@­Ó¦r¤¸ªº¦r¦ê
  8.             '**" Mid(E, 2) -> ±q²Ä2­Ó¦r¤¸°_Ū¤J¥þ³¡ªº¦r¦ê

  9.     Next
  10. End Sub
  11. Sub upperaf()  '²Ä¤@­Ó¦r¤j¼g


  12.     Dim E As Range, Rng As Range
  13.     If TypeName(Selection) <> "Range" Then Exit Sub '¤£¬ORange(Àx¦s®æ)¤£©¹¤U°õ¦æµ{¦¡
  14.     If Selection.Count = 1 And Selection(1) = "" Then Exit Sub  '¿ï¾Ü1Àx¦s®æ¥B¬°ªÅ¥Õ®É¤£©¹¤U°õ¦æµ{¦¡
  15.     For Each E In Selection.SpecialCells(xlCellTypeConstants)

  16.             E.Value = UCase(Mid(E, 1, 1)) & LCase(Mid(E, 2))  'Âà´«²Ä1­Ó¦r¤¸¬°¤j¼g
  17.             '**: Mid(E, 1, 1)-> ±q²Ä1­Ó¦r¤¸°_Ū¤J¤@­Ó¦r¤¸ªº¦r¦ê
  18.             '**" Mid(E, 2) -> ±q²Ä2­Ó¦r¤¸°_Ū¤J¥þ³¡ªº¦r¦ê

  19.     Next
  20. End Sub
½Æ»s¥N½X
¦^´_ 3# PJChen
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 3# PJChen

¦A¤Þ¥ÎG¤j¤jªº¼gªk~ ¦Û¤v§ï¤@¤U~
µ{¦¡³]­p«e­n¥ý¤ÀªR¤@¤U·Q­nªºµ²ªG¬O¤°»ò~ ¦A«ç»ò¨Ó¼g~
¨Ì±z»Ý­nªºªF¦è~
«ö¤U¥ô¤@­Ó«ö¶s®É~ ¤£ºÞ¬O¶}·sÀɩάO°õ¦æ¸ÓÀɤºªº¤º®e~ ´N¶i¦æ¦rªº¤j¼g½Õ¾ã
¦]¦¹¥Î¤@­ÓIF ¨Ó§PÂ_~ ¬O­n°õ¦æ¸ÓÀÉ®×ÁÙ¬O°õ¦æ·s¶}ªºÀÉ®×
©Ò¥H¥[¤F¤@­Ó¥´¶}EXCELªº«ü¥O,§PÂ_¬O¤£¬O­n¶}ÀÉ®×,
¨Ó§¹¦¨³Ì«áªºµ²ªG~
  1. Sub uppera() '¥þ³¡¤j¼g
  2. patch = Application.GetOpenFilename("Microsoft Excel ¬¡­¶Ã¯ (*.xls), *.xls")
  3. If patch = False Then
  4.     Dim E As Range, Rng As Range
  5.     If TypeName(Selection) <> "Range" Then Exit Sub '¤£¬ORange(Àx¦s®æ)¤£©¹¤U°õ¦æµ{¦¡
  6.     If Selection.Count = 1 And Selection(1) = "" Then Exit Sub  '¿ï¾Ü1Àx¦s®æ¥B¬°ªÅ¥Õ®É¤£©¹¤U°õ¦æµ{¦¡
  7.     For Each E In Selection.SpecialCells(xlCellTypeConstants)
  8.             E.Value = UCase(E)                          '¥þ³¡Âà´«¬°¤j¼g
  9.             '**: Mid(E, 1, 1)-> ±q²Ä1­Ó¦r¤¸°_Ū¤J¤@­Ó¦r¤¸ªº¦r¦ê
  10.             '**" Mid(E, 2) -> ±q²Ä2­Ó¦r¤¸°_Ū¤J¥þ³¡ªº¦r¦ê
  11.     Next
  12. Else
  13.     With Workbooks.Open(patch)
  14.         For Each E In .Sheets("¤u§@ªí1").Range("A:C")
  15.           E.Value = UCase(E)
  16.         Next
  17.     End With
  18. End If

  19. End Sub
  20. Sub upperaf()  '²Ä¤@­Ó¦r¤j¼g
  21. patch = Application.GetOpenFilename("Microsoft Excel ¬¡­¶Ã¯ (*.xls), *.xls")
  22. If patch = False Then
  23.     Dim E As Range, Rng As Range
  24.     If TypeName(Selection) <> "Range" Then Exit Sub '¤£¬ORange(Àx¦s®æ)¤£©¹¤U°õ¦æµ{¦¡
  25.     If Selection.Count = 1 And Selection(1) = "" Then Exit Sub  '¿ï¾Ü1Àx¦s®æ¥B¬°ªÅ¥Õ®É¤£©¹¤U°õ¦æµ{¦¡
  26.     For Each E In Selection.SpecialCells(xlCellTypeConstants)
  27.             E.Value = UCase(Mid(E, 1, 1)) & LCase(Mid(E, 2))  'Âà´«²Ä1­Ó¦r¤¸¬°¤j¼g                          '¥þ³¡Âà´«¬°¤j¼g
  28.             '**: Mid(E, 1, 1)-> ±q²Ä1­Ó¦r¤¸°_Ū¤J¤@­Ó¦r¤¸ªº¦r¦ê
  29.             '**" Mid(E, 2) -> ±q²Ä2­Ó¦r¤¸°_Ū¤J¥þ³¡ªº¦r¦ê
  30.     Next
  31. Else
  32.     With Workbooks.Open(patch)
  33.         For Each E In .Sheets("¤u§@ªí1").Range("A:C")
  34.           E.Value = UCase(Mid(E, 1, 1)) & LCase(Mid(E, 2))  'Âà´«²Ä1­Ó¦r¤¸¬°¤j¼g
  35.         Next
  36.     End With
  37. End If

  38. End Sub
½Æ»s¥N½X
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 5# hugh0620
±z¦n,
±z­×§ïªº²Ä¤@½g¥i¥HÂà´«¤å¦r,¦ý¶È­­©ó¦P¤@sheet¤¤ªº¤å¦r.
²Ä¤G½g§Ú­×¤F(*.xlsx),¦]¬°§Ú·Q­n¤GºØÀÉ®×Ãþ«¬³£¥i¥H¥Î,¦ýµL½×§Ú§ï¦¨ (*.xlsx), *.xls" ©Î  (*.xls), *.xlsx",·í§Ú«öÂà´«¶s®É¨Ã¤£·|¤GºØÃþ«¬³£¥X²{,¦Ó¥B¨C¦¸«öÂà´«¶sexcel´N·|·í±¼,
¦pªG§Ú¤@ª½¤£¥h²z¥¦,¨ä¹êexcel¤]¤£¥Î­«¶},¦ý¥¦¨Ã¤£·|Âà´«.
patch = Application.GetOpenFilename("Microsoft Excel ¬¡­¶Ã¯ (*.xlsx), *.xls")

¥t¥~½Ð±Ð¤@­Ó¦sÀÉ°ÝÃD,¥H¤U¦s¬°.xlsx®É¤@¤Á³£¨S¦³°ÝÃD,¦ý­Y¦s¦¨.xls®É,¦sÀɮɨS°ÝÃD,¦ý­n¥´¶}¦sÀɫ᪺¤å¥ó´N·|¥X²{¿ù»~°T®§,¥i§_À°§Ú¬Ý¤@¤U°ÝÃD©Ò¦b?
ActiveWorkbook.SaveAs "D:\" & [Q5] & " vs " & [C6] & "_PO#" & [V7] & "_" & [C16] & " booking to " & [C19] & ".xlsx"

TOP

¦^´_ 6# PJChen

§Aªº°ÝÃD§Ú­Ó¤H»{¬°¬O¦]¬°§Aªº¥¨¶°¦s©ñ¦ì¸m¡A»P¸ê®ÆÀɮ׬O¤À¶}ªºÀÉ®×
¥Ñ©ó2007ª©¥»¥H«á¡A§t¦³¥¨¶°ªº¬¡­¶Ã¯¡A»P¤@¯ë¬¡­¶Ã¯Àɮ׮榡¤£¦P¡A
©Ò¥H¡A§A¦b¾Þ§@®É³Qµø¬°2­ÓApplication¦b°õ¦æ(³o¬O­Ó¤H²q´ú¡A¤£¤@©w¥¿½T)
­n¸Ñ¨M³oºØ½Ä¬ð¡A°ß¦³±N¥¨¶°¦s¦¨¼W¯q¶°¡AµM«á¥[¸ü¼W¯q¶°«á¡A©Ò¦³ªº¬¡­¶Ã¯´N¥i¥H¦@¦P¨Ï¥Î¸Óµ{¦¡½X
±NÀɮ׸ÑÁY¨ì¨t²Î¹w³]¼W¯q¶°¦s©ñ°Ï
µM«á¨Ì·Ó°Êµe¥[¸ü¨Ï¥Î¸Õ¸Õ

¤j¤p¼gÂà´«.rar (10.62 KB)

    play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 7# Hsieh

ª©¤j,
±zªº«Øij«Ü¤£¿ù,¦ý¥Ñ©ó§Ú±q¨Ó¨S¦³¥Î¹L¼W¯q¶°ªº¥\¯à,§¹¥þ¤£¤F¸Ñ,±zªº¾Þ§@¦³ÂI§Ö,§Ú¬Ý¤£²M·¡,¥i¯à­n¦Û¤v¬ã¨s¤@¤U.
§Ú¥t¤@­Ó¦sÀɪº°ÝÃD¤£ª¾¬O§_¦³¤H¥i¥H¸Ñµª?

TOP

¦^´_ 8# PJChen

·§©À¬Û¦P¡A¥u¬O§A­n©T©w¦sÀɦì¸m¡A¨º»ò¼W¯q¶°
   ´N¨S¦³¤Ó¤j·N¸q
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 9# Hsieh
ª©¤j,
§Ú°Ýªº¥t¤@­Ó¦sÀÉ°ÝÃD,¸ò¤j¤p¼gÂà´«¬O§¹¥þ¤£¬Û¦Pªº, ¬O§Ú¨ä¥¦ªº¥¨¶°µ{¦¡§ÚºK¿ý¤U¨Óªº,
¥¦¦s¬°.xlsx®É¤@¤Á³£¨S¦³°ÝÃD,¦ý­Y¦s¦¨.xls®É,¦sÀɮɨS°ÝÃD,¦ý­n¥´¶}¦sÀɫ᪺¤å¥ó´N·|¥X²{¿ù»~°T®§,¦]¬°§Ú¤£ª¾¹D°ÝÃD©Ò¦b?
¥X²{ªº¿ù»~°T®§´N¬O«e­±©Ò¤W¶Çªºjpg¹Ï¤ùªº°T®§,·Q½Ð±Ð¬O§_¦³¤H¯à¬°§Ú¸Ñµª.
ActiveWorkbook.SaveAs "D:\" & [Q5] & " vs " & [C6] & "_PO#" & [V7] & "_" & [C16] & " booking to " & [C19] & ".xlsx"

TOP

        ÀR«ä¦Û¦b : ¤f»¡¤@¥y¦n¸Ü¡A¦p¤f¥X½¬ªá¡F¤f»¡¤@¥yÃa¸Ü¦p¤f¦R¬r³D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD