moradisndat
New Member
- Joined
- Feb 19, 2021
- Messages
- 15
- Office Version
- 2007
- Platform
- Windows
I hope it's ok to ask 2 questions in 1 post if they are not related.
Is there any difference in how fast the statements below will run? I'm just trying to find the best practice.
ThisWorkbook.Sheets("NHL").Visible=False
or
Sheets("NHL").Visible=False
or can object variable work
wsNHL.Visible=False
---------------------------------------
2nd question:
I was trying to use object variables to speed up code but had problems adding charts. The only way I could make it work was by using "ActiveSheet." Is there a better way to add an embedded chart than what I have below?
LR = ActiveCell.CurrentRegion.End(xlDown).Row
wsNew.Range("H13", "I" & LR).Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart. ' several lines follow to change ' chart properties
Thanks in advance
Is there any difference in how fast the statements below will run? I'm just trying to find the best practice.
ThisWorkbook.Sheets("NHL").Visible=False
or
Sheets("NHL").Visible=False
or can object variable work
wsNHL.Visible=False
---------------------------------------
2nd question:
I was trying to use object variables to speed up code but had problems adding charts. The only way I could make it work was by using "ActiveSheet." Is there a better way to add an embedded chart than what I have below?
LR = ActiveCell.CurrentRegion.End(xlDown).Row
wsNew.Range("H13", "I" & LR).Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart. ' several lines follow to change ' chart properties
Thanks in advance