Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 10, 10:13*am, Mike H. wrote:
In my code I determine a range that I wish to select. *What is the proper syntax to select that range. *Let's say I wish to add a line to all cells selected. *This does not work: My hope would be to have every cell from 11,1 to 65,7 selected but I get an error on the line Range(PrtRng).select. *Ideas? Dim PrtRng as Range Dim X as Double let X=65 Set PrtRng = Range(Cells(11, 1), Cells(X, 7)) Range(PrtRng).Select With Selection.Borders(xlEdgeBottom) * * *.LineStyle = xlContinuous * * *.Weight = xlThin * * *.ColorIndex = xlAutomatic End With Hi The Syntax Range(something) expects the something to be text e.g. Range ("A1:B10"). You have already set your range object PrtRng so you simply do PrtRng.Select (which, if you were a bit perverse, you might write as Range(PrtRng.Address).Select if you want to see the text in there) Note that you don't need to select the range object to work with it. You could simply do With PrtRng.Borders(xlEdgeBottom) etc regards Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
Find End in Undefined Range Select Range Trim | Excel Programming | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
Compare a selected Range with a Named range and select cells that do not exist | Excel Programming | |||
Select Sheet then Select Range | Excel Programming |