Type Mismatch Error in Excel VB on RowIndex

R

Rob Fenwick

I get an error on the last line of the below snipit
Type Mismatch. I'm doing a for loop and want to
use the variables StartRow and Endrow

Any help would be greatly appreciated.
Thanks in Advance

--------
Dim StartRow As Integer
Dim EndRow As Integer

StartRow = 1
EndRow = StartRow + 3

Sheets("Master").Select
Rows("1:4").Select 'STATIC version of what I want
Rows("StartRow:EndRow").Select ' Dynamic vers of it



*** Sent via Developersdex http://www.developersdex.com ***
 
M

Mike H

Try this

Rows(StartRow & ":" & EndRow).Select ' Dynamic vers of it

Because the variables where in quotes they were inyerpreted as text

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top