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

¤@­ÓÅܦâ°ÝÃD

¦^´_ 10# ©P¤j°¶
¤£¦n·N«ä¡A¤£¬O«Ü¤F¸Ñ³o¸òÅܦâ°ÝÃDªºÃöÁp¡C¦pªG¥u¬O­n¦bvba¤¤³]©w¦Û°Ê´«¦C¡A¨Ï¥Î.WrapText = True´N¥i¥H¤F¡C

TOP

¦^´_ 11# zyzzyva
©ú½T»¡, ¼Ó¤W¼Ó¥Dµo°Ý¤@­ÓÅܦâ°ÝÃD, §Ú§âµ{¦¡®M¤J¤p§Ì¤u§@ªí¤¤, ¦Ó§Ú¦b¤u§@ªíÀx¦s®æ®æ¦¡>¹ï»ô¤è¦¡¤¤>¤Ä¿ï¦Û°Ê´«¦C, ³o±¡ªp¤U, ¿é¤J¤å¦r¹Lªø¦C°ª«K¦Û¦æ½Õ¾ã, ¦ý²{®É¤å¦r¹Lªø,Àx¦s®æ¨S¦³½Õ¾ã¦C°ª, ¦]¦Ó¨Sªk§â¥þ³¡¿é¤Jªº¤å¦rÅã¥Ü, ¤ß·Q§Ú¤v¤Ä¿ï¤F¦Û°Ê´«¦C, ¬°¦ó¦³¦¹±¡ªp, ¬G·Q¦pªG¥[¤Jvbaµ{¦¡¬O§_¥i¥H°µ¨ì¤å¦r¹Lªø¦C°ª¦Û¦æ½Õ¾ã,  ¥H«K§â¿é¤J¤å¦r¥þ³¡Åã¥Ü, ÁÂ,

TOP

¦^´_ 12# ©P¤j°¶
¨º¬O¦X¨ÖÀx¦s®æªº°ÝÃD¡Aexcel¦X¨ÖÀx¦s®æ¦³«Ü¦h°ÝÃD¡A¥Îvba³]©wwraptext¤]¨S¥Î(¥i¥H¤â°Ê¦b¥Ø¼Ð¦Cªº¤U½t«ö¨â¤U¡A·|µo²{¤@¼ËµL®Ä)¡A¸Ô²Ó¥i¥H°Ñ¦Ò¡G
http://blog.contextures.com/archives/2015/12/03/autofit-merged-cells-row-height-update-20151203/
§Ú·Q±zÀ³¸Ó¬O¦X¨Ö¡BÅܦ⧹Àx¦s®æ­n¦b¸ÌÀY¿é¤J¤å¦r¡H§â¤U­±ªºcode¥[¨ì¦P¤@­Óworksheet¸Ì¸Õ¸Õ¬Ý¡C
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. Dim Vhight As Single
  3. If Target.WrapText = True Then
  4. With Target
  5. .Select
  6. .RowHeight = 1
  7. .WrapText = True
  8. .UnMerge
  9. .EntireRow.AutoFit
  10. Selection.Merge
  11. Vhight = .Width * .Height / Selection.Width
  12. If Vhight < 16 Then Vhight = 16
  13. .RowHeight = Vhight
  14. .VerticalAlignment = xlCenter
  15. End With
  16. End If
  17. End Sub
½Æ»s¥N½X

TOP

¦^´_ 13# zyzzyva
·PÁ¤j¤j,
§Ú·|Æp¬ã, ­Y¦³¤£°Ý³B, ¦A½Ð±Ð, ÁÂÁÂ,

TOP

¥»©«³Ì«á¥Ñ hong912 ©ó 2016-10-11 19:55 ½s¿è

¦^´_ 13# zyzzyva
¤j¤j¦n,
ÏްݤF¤@­ÓÅܦâ°ÝÃD, ±a¥X¥t¤@­Ó´«¦C°ÝÃD, ­Y¯à§â¨â­Óµ{¦¡¿Ä¦X, ´N¬O§_¥i¥H, ÁÂÁÂ!!
hong912

TOP

¦^´_ 15# hong912
Àx¦s®æ¦X¨Ö«á¤£¤Ó¦n¾Þ§@¡A½Ð°Ñ¦Ò13Fªº¦^ÂСC

TOP

¦^´_ 16# zyzzyva
«e½ú, §A¦n,
¥i§_©ú½T»¡©ú, ¦p¦ó©ñ©ó¦P¤@µ{¦¡°Ï¤º, ¨ü±Ð¤F, ·P®¦½ç!
hong912

TOP

¦^´_ 17# hong912
¬O2­Ó¨Æ¥ó¡A­n©ñ¦b¦P¤@­Óworksheet¡C«ö¥kÁä«á·|Åܦâ¦P®É¦X¨ÖÀx¦s®æ¡A¦pªG¦b¸ÌÀY¿é¤J¡A·|¦³´«¦Cªº®ÄªG(¦ý¤£¬O«Üº}«G)¡C
­Ó¤Hı±o¡A¦pªG·|»Ý­n¾Þ§@¤½¦¡©Îµ{¦¡¡A«D¥²­nºÉ¶qÁקK¨Ï¥Î¦X¨ÖÀx¦s®æ¡AÀx¦s®æ¦X¨Ö¤§«á¡A®e©ö¦³«Ü¦h©_©_©Ç©Çªº°ÝÃD¡C
  1. Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)

  2. With Selection
  3.     If .Interior.ColorIndex = 5 Then
  4.         .Interior.ColorIndex = 3

  5.     Else
  6.         .Interior.ColorIndex = 5
  7.         .Merge
  8.         .WrapText = True
  9.         
  10.     End If
  11. End With
  12. End Sub


  13. Private Sub Worksheet_Change(ByVal Target As Range)
  14. Dim Vhight As Single
  15. If Target.WrapText = True Then
  16. With Target
  17. .Select
  18. .RowHeight = 1
  19. .WrapText = True
  20. .UnMerge
  21. .EntireRow.AutoFit
  22. Selection.Merge
  23. Vhight = .Width * .Height / Selection.Width
  24. If Vhight < 16 Then Vhight = 16
  25. .RowHeight = Vhight
  26. .VerticalAlignment = xlCenter
  27. End With
  28. End If
  29. End Sub
½Æ»s¥N½X

TOP

¦^´_ 18# zyzzyva
ÁÂÁ«e½ú, °J¤ß·PÁÂ!
hong912

TOP

¦^´_ 20# hong912
¥i¥H¸ÕµÛ²z¸Ñ¤@¤Ucode¡A°õ¦æ¦X¨ÖÀx¦s®æªº¬Omerge¡A¥u­n§â¥¦§R°£´N¥i¥H¤F¡C
¨S¦³¦X¨Öªº¸Ü¡Awraptext¥i¥H¥¿±`§@¥Î¡A¥t¤@­Óchange¨Æ¥ó¤]¥i¥H§R±¼¡C
  1. Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
  2.     With Selection
  3.         If .Interior.ColorIndex = 5 Then
  4.             .Interior.ColorIndex = 3
  5.         Else
  6.             .Interior.ColorIndex = 5
  7.             .WrapText = True
  8.         End If
  9.     End With
  10. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¶¢¤HµL¼Ö½ì¡A¦£¤HµL¬O«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD