rows().select VBA question

M

mohavv

How can I make this work, keep getting errors.

Sub test2()

a = 327
b = 336

Rows(a:b).Select

End Sub

I just want to select/delete severals row at once at a variable spot.

Cheers,

Harold
 
C

carlo

How can I make this work, keep getting errors.

Sub test2()

a = 327
b = 336

Rows(a:b).Select

End Sub

I just want to select/delete severals row at once at a variable spot.

Cheers,

Harold

it's

Rows(a & ":" & b).select

hth

Carlo
 
D

Dana DeLouis

How can I make this work, keep getting errors.
Sub test2()
a = 327
b = 336
Rows(a:b).Select

Just a different method without strings:

Sub Demo()
Dim a As Long, b As Long

a = 327
b = 336

Rows(a).Resize(b - a + 1).Select
End Sub
 
Top