select multiple rows using variables

  • Thread starter Thread starter JLR-Mart
  • Start date Start date
J

JLR-Mart

I have a program where I want to select a range of rows but don't know the
row numbers as these are stored as variables e.g. startrow and endrow. How
can I select rows startrow through endrow?

rows("startrow:endrow").select doesn't work and it appears that this
method must have numbers as the input e.g. rows("28:34").select

anyone know how I might acheive this?
 
Sub aRowsByAnyOtherName()
alpha = 13
omega = 17
Rows(alpha & ":" & omega).Select
End Sub
 
Sub selectvarrows()
startrow = 12
endrow = 14
Rows(startrow & ":" & endrow).Select
End Sub
 
Back
Top