Range with a variable

  • Thread starter Thread starter Animal via OfficeKB.com
  • Start date Start date
A

Animal via OfficeKB.com

Hello there,

Can't understand why I can't find the solution to thins simple problem
anywhere.

Set d = Range("Year:" & c.Offset(-1, 0)).Find(Range("ReportYear"),
LookIn:=xlValues)

I don't know how to wright the syntax for a range which uses a variable. Must
be a common problem or? It workes when I do like this:
b = 1
Set d = Range("A" & b)
But when i want a range from "a" to "b" and use the symbol of ":" it doesn't
work.

Can someone help me please, I get an error all the time.
/Animal
 
Something like this?

Set d = Range("A" & b, "C" & f)

and b and f are numbers. CHange to suit.
 
Thank you very much it worked of course.

I had already tried it, but nothing happend and I found another problem for
that in a merged cell.

Take care
 

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