M
MakeLei
Hi,
I have a problem using sheetscodename. I have changed some of the
sheetcodenames from "Sheetxxx" to totally different. Now I need to clear
contents of the codenames that begins with Sheet and includes number in the
end. How could I do that. I have now code that clears the content of ALL
sheets and I do not want that to happen.... (also if there is a better way
to program code below all comments welcome)
Thanks for helping me ;o)
Makelei
the code:
Sub CleanReports()
Dim ws As Worksheet
Dim Pic As Shape
Application.ScreenUpdating = False
'************************* Goes trough reports and cleans the content
Application.DisplayAlerts = False
For Each ws In ActiveWorkbook.Worksheets
If ws.CodeName > "Sheet" Then ws.Activate
Columns("AA").Select
Selection.ClearContents
Range("A1").Select
For Each Pic In ActiveSheet.Shapes
If Pic.Type = msoPicture Then
Pic.Delete
End If
Next Pic
Next ws
Application.DisplayAlerts = True
Sheets("ProgIDs").Select
Range("D27").Select
End Sub
I have a problem using sheetscodename. I have changed some of the
sheetcodenames from "Sheetxxx" to totally different. Now I need to clear
contents of the codenames that begins with Sheet and includes number in the
end. How could I do that. I have now code that clears the content of ALL
sheets and I do not want that to happen.... (also if there is a better way
to program code below all comments welcome)
Thanks for helping me ;o)
Makelei
the code:
Sub CleanReports()
Dim ws As Worksheet
Dim Pic As Shape
Application.ScreenUpdating = False
'************************* Goes trough reports and cleans the content
Application.DisplayAlerts = False
For Each ws In ActiveWorkbook.Worksheets
If ws.CodeName > "Sheet" Then ws.Activate
Columns("AA").Select
Selection.ClearContents
Range("A1").Select
For Each Pic In ActiveSheet.Shapes
If Pic.Type = msoPicture Then
Pic.Delete
End If
Next Pic
Next ws
Application.DisplayAlerts = True
Sheets("ProgIDs").Select
Range("D27").Select
End Sub