Selecting rows

G

Guest

Hi
Thanks to Frank & Tom I pretty much have my macro working. I just have this one (final) problem. The following code generates a type mismatch error. Can anybody help

Sub Finder(

Dim FromRow, ToRow As Intege

SelTeam = Range("a1") 'A1 contains ED
FromRow = WorksheetFunction.VLookup(SelTeam, Range("A1:C6"), 2, False) '2
ToRow = WorksheetFunction.VLookup(SelTeam, Range("A1:C6"), 3, False) '2
Rows("FromRow, ToRow").Hidden = False '**this is the line that causes the proble

End Su

Many thanks, Ian
 
R

Ron de Bruin

Try this Ian

Rows(fromrow & ":" & torow).Hidden = False


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




Ian said:
Hi,
Thanks to Frank & Tom I pretty much have my macro working. I just have this one (final) problem. The following code generates
a type mismatch error. Can anybody help?
 
J

JE McGimpsey

Take out the quote marks.

Ian said:
Hi,
Thanks to Frank & Tom I pretty much have my macro working. I just have this
one (final) problem. The following code generates a type mismatch error. Can
anybody help?
 
T

Tom Ogilvy

if fromrow is 20
and to torow is 25 then
Range(FromRow & ":" & ToRow).entireRow.Hidden = False

--
Regards,
tom Ogilvy


"Ian" <anonymous@dis
cussions.microsoft.com> wrote in message
Hi,
Thanks to Frank & Tom I pretty much have my macro working. I just have
this one (final) problem. The following code generates a type mismatch
error. Can anybody help?
 
J

JE McGimpsey

I don't know why the rest of my reply didn't paste in (operator error,
obviously):

Take out the quote marks. Join the rows with a ":":

Rows(FromRow & ":" & ToRow).Hidden = False
 

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