- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 15
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-12
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2014-11-5 22:10 ½s¿è
¦^´_ 3# justinbaba
For Each E In .Cells.Columns(i)
¹ê´úµo²{ .Columns(i) «á±¨S¦³¥[¤W .Cells ,
·|Åܦ¨«ü©w¾ãÄæ¦Ó«D³æÓÀx¦s®æ,
©Ò¥H·|¦³¿ù»~.
¤£¹L³o»P§Ú¹w´Áªºµ²ªG¤£¦P,
¨Ï¥ÎRangeÅܼƳz¹L For Each ¹ï¾ãÄ檺¤¸¯À°µ³v¤@³B²z,
¸ÑªR«á³B²zªº¤¸¯À«oÁÙ¬O¾ãÄæ?
§Ú¦³¨Ç¯Ç´e.
¦Ü©ó¨º¦æ Mypath = "\C:\Users\leon\Desktop\Test\" ©Ç©Çªº,
C: «e±¤£À³¸Ó¦³ \ ¥X²{.
Æ[¹î§Aªºµ{¦¡¹ï¾ãÓ¤u§@ªíªº¨C¤@¦C³£¦³°µ°ª«×³]©w,
³oÀ³¸Ó¤£¬O§A·Qnªºµ²ªG.
«Øij¨îµ{¦¡¹ê»Ú·|§@¥Î¨ìªº½d³ò,
ÁקK¦³«D©Ò¹w´Á¬Æ¦Ü¬O¦h¾lªº°Ê§@©ìªø§@·~®É¶¡,
³oÓ¥i¥Î .Cells(Rows.Count, l).End(xlUp).Row ¤è¦¡¨Ó¨ú±o³Ì©³ºÝ¦³¸ê®Æªº¦C¸¹.
ÁÙ¦³¹ï¥Î©ó ¦C¸¹ ªí¥ÜªºÅܼÆ,
«Øij¤£½×¹ê»Ú¤W·|¨Ï¥Î¨ì¦h¤jªº¦C¸¹,
³£n "¾i¦¨²ßºD" ¤@«ß³]¬° Long ¦Ó«D Integer,
¦]¬°·|¦³ ·¸¦ì(¶W¹L¥iªí¥Ü¼Æ¦rªº³Ì¤jÈ) ªº·ÀI.
³Ì«á³o¨â¦æ :
E.ColumnWidth = 25 '½Õ¾ãÀx¦s®æ¼e«×
E.RowHeight = 50 '½Õ¾ãÀx¦s®æ°ª«×
³]©wªº¼e«×¬O§@¥Î¨ì¦s©ñ¹ÏÀɦWºÙªºÀx¦s®æ,
¦Ó«D©ñ¸m¹Ï¤ùªºÀx¦s®æ,
§Ú²qÀ³«D§A·Qnªºµ²ªG.
«Øij§ï¬°
E.Cells(1, 2).ColumnWidth = 25 '½Õ¾ãÀx¦s®æ¼e«×
E.Cells(1, 2).RowHeight = 50 '½Õ¾ãÀx¦s®æ°ª«×
ºî¤W©Òz«Øijµ{¦¡×§ï¦p¤U- Sub ChangeSize()
- Dim Mypath As String, E As Range, l As Long, m As Long ', MyPic As Object
- Mypath = "C:\Users\user12\Pictures\"
- With Sheets("·Ó¤ù¯Á¤Þ")
- .Pictures.Delete
- For l = 1 To 7 Step 3 'AÄæ ->1,DÄæ ->4,GÄæ ->7
- m = .Cells(Rows.Count, l).End(xlUp).Row
- For Each E In Range(.Cells(1, l), .Cells(m, l)) ' 'AÄæ ->1,DÄæ ->4,GÄæ ->7
- E.Cells(1, 2).ColumnWidth = 25 '½Õ¾ãÀx¦s®æ¼e«×
- E.Cells(1, 2).RowHeight = 50 '½Õ¾ãÀx¦s®æ°ª«×
- If Dir(Mypath & E & ".jpg") <> "" Then
- 'Set MyPic = ActiveSheet.Pictures.Insert(Mypath & E & ".jpg")
- With .Pictures.Insert(Mypath & E & ".jpg")
- .ShapeRange.LockAspectRatio = msoFalse
- .Left = E.Cells(1, 2).Left
- .Top = E.Cells(1, 2).Top
- .Width = E.Cells(1, 2).Width '=Àx¦s®æ¼e«×
- .Height = E.Cells(1, 2).Height '=Àx¦s®æ°ª«×
- End With
- End If
- Next
- Next
- End With
- End Sub
½Æ»s¥N½X |
|