下面是一个分页的宏,求高手帮忙解读下,我现在分页的材料需要改变下,现在要修改这个宏! 10
Sub分页()DimcAsRange,rAsWorksheetSetr=ActiveSheetk=r.UsedRange.Rows.CountSetc=r.Range("...
Sub 分页()
Dim c As Range, r As Worksheet
Set r = ActiveSheet
k = r.UsedRange.Rows.Count
Set c = r.Range("a2:a" & k).Find("订单号")
Do While Not c Is Nothing
r.HPageBreaks.Add before:=c
ro = c.Row + 1
Set c = r.Range("a" & ro & ":a" & k).Find(c)
Loop
End Sub
Sub 删除分页()
Dim HPK As HPageBreak
Dim r As Worksheet
On Error Resume Next
Set r = ActiveSheet
k = r.HPageBreaks.Count
For i = 1 To k
r.HPageBreaks(i).Delete
Next i
End Sub
这个是分页和删除分页的,求解释!最好能加QQ! 展开
Dim c As Range, r As Worksheet
Set r = ActiveSheet
k = r.UsedRange.Rows.Count
Set c = r.Range("a2:a" & k).Find("订单号")
Do While Not c Is Nothing
r.HPageBreaks.Add before:=c
ro = c.Row + 1
Set c = r.Range("a" & ro & ":a" & k).Find(c)
Loop
End Sub
Sub 删除分页()
Dim HPK As HPageBreak
Dim r As Worksheet
On Error Resume Next
Set r = ActiveSheet
k = r.HPageBreaks.Count
For i = 1 To k
r.HPageBreaks(i).Delete
Next i
End Sub
这个是分页和删除分页的,求解释!最好能加QQ! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询