【发布时间】:2015-07-28 16:13:33
【问题描述】:
我需要在指定值的每个单元格之后在工作表上插入多个分页符。我有一段代码,但目前没有任何反应
Statement.Activate
Dim c As Range
Dim FirstAddress As String
Set c = Columns("A").Find(What:="Please enter your Client Ref on the reverse", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True)
If Not c Is Nothing Then
FirstAddress = c.Address
Do
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=c.Offset(1)
Set c = Columns("A").FindNext(c)
Loop While Not c Is Nothing And c.Address <> FirstAddress
End If
谁能明白为什么这不起作用?
【问题讨论】:
-
请检查您在查找中插入的字符串:您的代码对我有用! (但我搜索了“asdf”)
标签: vba page-break