ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with selecting a range... (https://www.excelbanter.com/excel-programming/272321-re-help-selecting-range.html)

Tom Ogilvy

Help with selecting a range...
 
If row 3 is empty

for each r in Worksheets("Sheet1").Range("D4").CurrentRegion



Next

if it does

Dim rng1 as Range, r as Range
With Worksheets("sheet1")
set rng1 = .Range(.Range("D4").end(xltoright),.Range("D4").en d(xldown))
End With
for each r in rng1

Next

--
Regards,
Tom Ogilvy


"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?





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

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