Thread: Selecting rows
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis[_3_] Dana DeLouis[_3_] is offline
external usenet poster
 
Posts: 690
Default Selecting rows

Just personal preference is to avoid using strings. Here is just one
additional idea.

Dim s, e 'start & end rows to delete
s = 5
e = 10
Rows(s).Resize(e - s + 1).Delete

Note that Excel assumes Shift:=xlUp when it is the entire row.

HTH
Dana DeLouis

"Walshy" wrote in message
...
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