Select a range in code

G

Guest

I an writing a subroutine that passes a cell value and uses it to select
certain cells for manipulation. I would like to Select a range of cells to
set the properties on but cant get the syntax correct.

The code looks like this:
Sub SingleDoor(SCell as Integer)
Range("O" & SCell+5 ":Q" Scell+12).select
My problem is with the quotes. Any see the problem?
 
A

Alan Beban

JCanyoneer said:
I an writing a subroutine that passes a cell value and uses it to select
certain cells for manipulation. I would like to Select a range of cells to
set the properties on but cant get the syntax correct.

The code looks like this:
Sub SingleDoor(SCell as Integer)
Range("O" & SCell+5 ":Q" Scell+12).select
My problem is with the quotes. Any see the problem?

Range("O" & SCell + 5 & ":Q" & SCell + 12).Select

Alan Beban
 
B

Bob Phillips

Range("O" & SCell + 5 & ":Q" & SCell + 12).Select

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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