½Ð°ÝHsiehª©¥D HPageBreaks(1).Location HpageBreak() ¤¤ªº¤Þ¼Æ 1 ªº·N¸q¬°¦ó?
- ©«¤l
- 199
- ¥DÃD
- 45
- ºëµØ
- 0
- ¿n¤À
- 252
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 7 (X64)
- ³nÅ骩¥»
- office 2010 (x64)
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2010-12-24
- ³Ì«áµn¿ý
- 2020-3-31
|
½Ð°ÝHsiehª©¥D HPageBreaks(1).Location HpageBreak() ¤¤ªº¤Þ¼Æ 1 ªº·N¸q¬°¦ó?
Hsiehª©¥D,¦b¦Û°Ê¤À¶ªº°Q½×¤¤§A¦³´£¨ì¦C¤À¶ªº¤èªk:
Set ActiveSheet.HPageBreaks(1).Location = Range("A51")
HPageBreaks(1) ¤¤ªº¤Þ¼Æ 1 ¬O¦ó·N,§Ú¬d¤£¨ì»¡©ú,½Ð«üÂI¬°²ü?
²Ä(I)±ø½u©Î¤u§@ªí(I)©Î²Ä(I)¶? |
|
V98
|
|
|
|
|
- ©«¤l
- 199
- ¥DÃD
- 45
- ºëµØ
- 0
- ¿n¤À
- 252
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 7 (X64)
- ³nÅ骩¥»
- office 2010 (x64)
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2010-12-24
- ³Ì«áµn¿ý
- 2020-3-31
|
Hsiehª©¥D,没¦³§Aªº»¡©ú,¤£ª¾¹DVBAªº»¡©úÀÉ©MExcelªº»¡©úÀɬO¤À¶}ªº,´N¬O»¡Excel ¬¡¶Ã¯ªº»¡©úÀÉ©MVBA¬O¤£¦Pªº¥¥x,©Ò¥H·í§Ú¦bExcelªº¬¡¶Ã¯¬O§ä¤£¨ìHPageBreaksª«¥óªº.
¦A¦^¨ì§Ú̪º¥DÃD,¤À¶½uªº³]©w´N¹³¬O¸õ¶²Å¸¹¤@¼Ë,¥i¥H¸g¹L¹BºâµM«áµ¹HpageBreaks·í¤Þ¼Æ¨Ï¥Î¬O¶Ü?
count ·|¶Ç¦^¥Nªí¶°¦X¤¤ª«¥ó¼Æªº Long È, ·N«ä¬O¦pªGn¤À¶ªº¤u§@ªín¤À50¶,¨º»òcountªºÈ = 50 ¬O¶Ü?»¡©ú¤¤ªºª«¥ó¬O«ü¨CÓ¤À¶¬O¶Ü?
item¶Ç¦^¶°¦X¤¤ªº³æ¤@ª«¥ó¡C¬O«ü³æ¤@¤À¶ªºLocation¶Ü? |
|
V98
|
|
|
|
|
- ©«¤l
- 199
- ¥DÃD
- 45
- ºëµØ
- 0
- ¿n¤À
- 252
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 7 (X64)
- ³nÅ骩¥»
- office 2010 (x64)
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2010-12-24
- ³Ì«áµn¿ý
- 2020-3-31
|
1).¤À¶:¦p¥H¥H«eµ{¦¡ªºÆ[ÂI´N¬O¸õ¶¶Ü?§Únªº´N¬O¸õ¶±±¨î.
2)1.EXCEL¦Û°Ê¤À¶®É¡A·|¥H§A¤WÃä¬É»P¤UÃä¬É¤§¶¡©Ò¯à®e¯Çªº¦C¼Æ§@¬°¹w³]¤À¶.
ª©¥DExcel·|¦b¤W¤UÃä¬É¸Ëº¡«á©ñ¤W¤À¶½u¬O¶Ü?¦pªG³o±ø¤À¶½u¤£©M¨Ï¥ÎªÌªº·N«ä,¨Ï¥ÎªÌ¬O¥i¥H³zµ{¦¡©wq·sªº¤À¶¦pªG¬O³o¼Ë´N²³æ¤F.(¤£n¥h²z·|Excel¦Û¤v¶]¥X¨Óªº¤À¶½u´N¥i¥H¤F)
¦pªGExcel¸õ¥X¨Óªº¤À¶¬O(¨C53ÓLine),¨º§Ú̱±¨îªº¤À¶¤p©ó53(¨Ò¦p:50),¨º»ò§Úªº³øªíÀÉ´N¥i¥H¨C50¦C¸õ¤@¶¬O¶Ü?
2)LocationÄÝ©Ê¥Nªí¬O¤À¶½u©Ò¦b¦ì¸m¡A¨Ã¤£¬O«ü¤À¶½u¥»¨
¤À¶½u©Ò¦bªº¦ì¸m¤£´N¬O¦b¨º¸Ì·|¸õ¤@¶¶Ü?LocationÄÝ©Ê¥Nªí¬O¤À¶½u©Ò¦b¦ì¸m,¦bExcelªº¤u§@ªí¤£¬O·|¦³¤@±øµê½u¶]¥X¨Ó¶Ü?¨Ã¤£¬O«ü¤À¶½u¥»¨,¥L̤£¬O¤@Å骺¶Ü? |
|
V98
|
|
|
|
|
- ©«¤l
- 199
- ¥DÃD
- 45
- ºëµØ
- 0
- ¿n¤À
- 252
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 7 (X64)
- ³nÅ骩¥»
- office 2010 (x64)
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2010-12-24
- ³Ì«áµn¿ý
- 2020-3-31
|
Hsiehª©¥DÁÂÁÂ,§Ú§ä¨ì¤F¸Ñ¨M¤è®×¤F:
Sub ¦Û°Ê¤À¶
Dim rows_count As Long
Dim page_count As Long
Dim i As Long
Dim row_index As Long
Dim str_row_index As String
Dim first_row As Long
ActiveWindow.View = xlPageBreakPreview
rows_count = Range("A1").CurrentRegion.Rows.Count
first_row = 50
For i = first_row To rows_count Step 50
page_count = page_count + 1
str_row_index = "A" + Trim(Str(i + 1))
Set ActiveSheet.HPageBreaks(page_count).Location = Range(str_row_index)
Next i
ActiveWindow.View = xlNormalView
End Sub |
|
V98
|
|
|
|
|