ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select a range in code (https://www.excelbanter.com/excel-programming/319336-select-range-code.html)

JCanyoneer

Select a range in code
 
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?

Alan Beban[_2_]

Select a range in code
 
JCanyoneer wrote:
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

Bob Phillips[_6_]

Select a range in code
 
Range("O" & SCell + 5 & ":Q" & SCell + 12).Select

--

HTH

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


"JCanyoneer" wrote in message
...
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?




Frank Kabel

Select a range in code
 
Hi
see your other post

--
Regards
Frank Kabel
Frankfurt, Germany
"JCanyoneer" schrieb im Newsbeitrag
...
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?





All times are GMT +1. The time now is 11:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com