Select range in VBA through variabel

  • Thread starter Thread starter Mr. Smith
  • Start date Start date
M

Mr. Smith

Hi I try this code, but I will not work.

sub selectnamedrange(fblock as Integer)
dim frow_string
frow_string = "f" & fblock & "_frow"
Range(frow_string).Select

' Which is translated into Range("f1_frow").Select
' f1_frow is a named range in the current worksheet.....
' The sub contains more code, but this is the part that does not work....
end sub.

Any hints appreciated

Mr. Smith
 
Works fine for me. Are you sure that fblock is 1?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Works now....
Needed ActiveSheet.range instead of just Range

thanks anyway Bob

Kind regards
Mr. Smith
 

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

Back
Top