Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Range definition using Cells

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
How do I write the range ActiveSheet.Range(A5:B5,D5:AM5) using the cells notation ?
I want to define the range using row numbers and column numbers...
 
From Referring to Excel Ranges
[tt]
ActiveSheet.Range(Cells(2, 2), Cells(5, 5)).Interior.Color = vbYellow
[/tt]
Makes Range B2-E5 yellow

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
You might try,
Code:
With ActiveSheet
   Union(Range(.Cells(5, 1), .Cells(5, 2)), Range(.Cells(5, 4), .Cells(5, 39)))
End With

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
 
Thank you SkipVought,
You've pushed me in the right direction ;-)
 
Did you solve your issue? If so, would you mind sharing it here for the benefit of others?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
If you want to make your life a little easier in determining the R1C1 value, you can switch the excel worksheets to R1C1 instead of Letter Row format.

Link
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top