Small Paul
Board Regular
- Joined
- Jun 28, 2018
- Messages
- 118
Hi
I have a number of macros I have written on Excel 2013. I am now transferring them across to other users' machines as I am leaving. They all run Excel 2016. For some reason, the macros fail on 2016.
The start of one macro is as follows:
Macro fails AFTER selecting cell B2
Does anybody know why this might happen?
Cheers
Small Paul.
I have a number of macros I have written on Excel 2013. I am now transferring them across to other users' machines as I am leaving. They all run Excel 2016. For some reason, the macros fail on 2016.
The start of one macro is as follows:
HTML:
Sub Daily_Open_Trades_Pivot()
'
' Daily_Open_Trades_Pivot Macro
'
Dim lr As Long
lr = Cells(Rows.Count, 1).End(xlUp).row
sheets("Sheet1").delete
sheets.Add.Name = "Pivot"
range("B2").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Table1", Version:=xlPivotTableVersion15).CreatePivotTable TableDestination _
:="Pivot!R2C2", TableName:="PivotTable10", DefaultVersion:= _
xlPivotTableVersion15
sheets("Pivot").Select
Macro fails AFTER selecting cell B2
Does anybody know why this might happen?
Cheers
Small Paul.