Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Store the location of the active cell and then return it to the stored location

Sub set()     Set myActiveCell = ActiveCell     Set myActiveWorksheet = ActiveSheet     Set myActiveWorkbook = ActiveWorkbook          'take actions here          myActiveWorkbook.Activate     myActiveWorksheet.Activate     myActiveCell.Activate End Sub