View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bruce Roberson Bruce Roberson is offline
external usenet poster
 
Posts: 47
Default Selecting Cells to set up Advanced Filter

I am trying to select a range through a macro that starts
with an offset three cells above a range named start. Line
1 does this correct. But I then want to continue selecting
a cell that is 4 cells down without losing the first
location I selected. But line 2 makes me lose the first
cell I selected.

Then, after I've done that, I need to select the end down
and to the end of the right range as lines 3 and four
below do.

Once I've Highlighted all that, I want the macro to give
this area a range name called "UploadRange", but I don't
want it referring to an absolute range like it does here
in line 6 of this sub.

Once I've completed that then lines 7, 8, and 9 here
should be able to execute the advanced filter based on the
constant range called "criti". I think that lines 7, 8,
and 9 here are ok, but let me know if they dont' look
right.

Then, when I get through with the advanced filter, I had
it selecting a cell just to get rid of the highlight that
would be left from the advanced filter selections.


Sub HideZeros()
Range("Start").Offset(-3, 0).Select
Range("Start").Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveWorkbook.Names.Add Name:="UploadRange",
RefersToR1C1:="=MJE!R10C1:R53C48"
Range("UploadRange").AdvancedFilter
Action:=xlFilterInPlace, CriteriaRange:= _
Range("Criti"), Unique:=False
Range("Q6").Select
End Sub