View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Type Mismatch Error in Excel VB on RowIndex

Try this

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

Because the variables where in quotes they were inyerpreted as text

Mike

"Rob Fenwick" wrote:

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 ***