vandango05
Board Regular
- Joined
- Oct 6, 2008
- Messages
- 110
Hi.
I've got a worksheet with many macros that have worked fine in Excel 2010 that i've just stopped using buy many colleagues still are. Here is an example of some code that will no longer run.
It fails at the line
another section of code i'm having problems with simply filters some data
It appears that 2016 doesn't much like the ActiveSheet part. No doubt i'm going to have lots more issues as more users adopt 2016 so any help would be appreciated.
I've got a worksheet with many macros that have worked fine in Excel 2010 that i've just stopped using buy many colleagues still are. Here is an example of some code that will no longer run.
Code:
Sub deleteimages()Dim s As String
Dim pic As Picture
Dim rng As Range
' Set ws = ActiveSheet
Set ws = ActiveWorkbook.Worksheets("Quotation")
Set rng = ws.Range("A26:L8000")
For Each pic In ActiveSheet.Pictures
With pic
s = .TopLeftCell.Address & ":" & .BottomRightCell.Address
End With
If Not Intersect(rng, ws.Range(s)) Is Nothing Then
pic.Delete
End If
Next
End Sub
It fails at the line
Code:
For Each pic In ActiveSheet.Pictures
another section of code i'm having problems with simply filters some data
Code:
ActiveSheet.Range("$K$5:$K$7475").AutoFilter Field:=1, Criteria1:=">0", _
Operator:=xlAnd
It appears that 2016 doesn't much like the ActiveSheet part. No doubt i'm going to have lots more issues as more users adopt 2016 so any help would be appreciated.