View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
isabelle isabelle is offline
external usenet poster
 
Posts: 99
Default .SpecialCells(xlCellTypeBlanks).Delete without going to the sheet

hi L. Howard,

Sheets("Project Priorities").Range(Cells(2, blnkCol - 2), Cells(blnkRow, blnkCol)) _
.SpecialCells(xlCellTypeBlanks).Delete (xlShiftUp)

isabelle

Le 2016-06-17 Ã* 00:40, L. Howard a écrit :
The whole macro is below, which does what I want. It is in a standard module
and will be run from any of about 8 to 10 different worksheets.

This snippet deleting blank cells in a range ends up leaving me with the
"Project Priorities" sheet as the active sheet.

Sheets("Project Priorities").Activate Range(Cells(2, blnkCol - 2),
Cells(blnkRow, blnkCol)) _ .SpecialCells(xlCellTypeBlanks).Delete
(xlShiftUp)

How would I return to the original sheet (or never leave it) that I run the
code on? I know I should be able to do work on cells on other sheet with no
need to select the sheet, but my head is not getting around how to do it if
the activesheet can be a different each time the code is executed.

Thanks, Howard