Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with selecting a range...
Try this EAB
Dim RNG As Range With Worksheets("Sheet1") a = .Range("D4").End(xlDown).row b = .Range("D4").End(xlToRight).Column Set RNG = .Range(Range("D4"), .Cells(a, b)) End With For Each cell In RNG -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "EAB" wrote in message ... I noticed someone was trying to select a range in the newsgroup postings and I thought that I could use this as well. When using the code below, the error occurs: MyRange = Range(Selection, Selection.End (xlToRight)).Select & Range(Selection, Selection.End (xlDown)).Select For Each R In Worksheets("Sheet1").Range(MyRange).Cells I want to select a range based off of D4 but I don't want o have to manually input the last cell. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
selecting a range | Excel Discussion (Misc queries) | |||
Please help with selecting a range | Excel Discussion (Misc queries) | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
Selecting a Range | Excel Discussion (Misc queries) | |||
selecting a range | Excel Programming |