H
Harrison Tomlinson
The marco opens a new sheet and returns the name of the deleted styles
in the workbook of the new sheet. Or, it's suppose too. The problem is
that sometimes it will not return the name of the deleted styles to
the new sheet. The only reason for it doing this that I could come up
with is that the macro works in excel 2003 workbooks but not 2007
workbooks. This could be completely wrong, it is only a guess. The
code is as follows:
ActiveWorkbook.Sheets.Add Before:=Worksheets(1)
ActiveSheet.Name = "Deleted Styles"
DelCount = 0
For Each styT In ActiveWorkbook.Styles
If DelCount < 30000 Then
If styT.BuiltIn <> True Then
styT.Delete
Range("A1").Offset(DelCount).Select
Range("A1").Offset(DelCount).Value = styT.Value
DelCount = DelCount + 1
Else
End If
Else
Exit Sub
End If
Next styT
Any solutions would be appreciated. I believe the problem has
something to do with the "Range("A1").Offset(DelCount).Value =
styT.Value" but again, I could be wrong.
Thanks - HT
in the workbook of the new sheet. Or, it's suppose too. The problem is
that sometimes it will not return the name of the deleted styles to
the new sheet. The only reason for it doing this that I could come up
with is that the macro works in excel 2003 workbooks but not 2007
workbooks. This could be completely wrong, it is only a guess. The
code is as follows:
ActiveWorkbook.Sheets.Add Before:=Worksheets(1)
ActiveSheet.Name = "Deleted Styles"
DelCount = 0
For Each styT In ActiveWorkbook.Styles
If DelCount < 30000 Then
If styT.BuiltIn <> True Then
styT.Delete
Range("A1").Offset(DelCount).Select
Range("A1").Offset(DelCount).Value = styT.Value
DelCount = DelCount + 1
Else
End If
Else
Exit Sub
End If
Next styT
Any solutions would be appreciated. I believe the problem has
something to do with the "Range("A1").Offset(DelCount).Value =
styT.Value" but again, I could be wrong.
Thanks - HT