Thread: Selecting rows
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default Selecting rows

One of the more important aspects of Tom Ogilvy's solution was unstated
(though clear): *avoid* the ".Select" and "Selection". That syntax is
superfluous and inefficient.

Alan Beban

wrote:

Thanks loads this is great !!!


-----Original Message-----
Normally it would be

Rows(1:3).Delete Shift:=xlup


so you could do

j = 3
k = 20
Rows(j & ":" & k).Delete shift:=xlup

--
Regards,
Tom Ogilvy


"Walshy"

g.uk wrote in message news:156501c49b24$0df95af0


...

I am having trouble selecting rows in a macro and


deleting

them.

I know you normally would write:
Rows("a1:a3").select
Selection.Delete Shift:=xlUp

problem I am having is the rows are vaiables..

I have wrote code to pick up a set a start & end row as
dim startrow and dim endrow

How do I the select that range ???

I tried Rows(startrow:endrow).select but no joy ???

Help me please...

Thanks



.