You need the value of shortest in the Select, not just a string.
Instead of:
Rows("shortest:shortest").Select
use:
Rows(shortest & ":" & shortest).Select

Signature
Gary''s Student - gsnu200772
> i have a vba code included the following:
> shortest = count(1)
[quoted text clipped - 14 lines]
>
> Can any pro point out my mistake?Thank you very much
youu917@gmail.com - 12 Mar 2008 01:57 GMT
On Mar 11, 5:58 pm, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> You need the value of shortest in the Select, not just a string.
>
[quoted text clipped - 29 lines]
>
> - Show quoted text -
thank you
youu917@gmail.com - 12 Mar 2008 02:11 GMT
On Mar 11, 5:58 pm, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> You need the value of shortest in the Select, not just a string.
>
[quoted text clipped - 29 lines]
>
> - Show quoted text -
Sorry, i found that the code is a bit weird and unstable. i try to run
it at the first time, it works. However, i try to run second time, it
prompt out the "type mismatch" error message again
Hi
"shortest:shortest" is a piece of text - VBA does not delve inside the
text string to extract the variables. You need
shortest & ":" & shortest
The & character will force this to be a text string with shortest
replaced with its numerical value.
regards
Paul
On Mar 11, 9:31 am, youu...@gmail.com wrote:
> i have a vba code included the following:
> shortest = count(1)
[quoted text clipped - 14 lines]
>
> Can any pro point out my mistake?Thank you very much