By using listi.net you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

listi.net

 


Excel Range

A range in Excel is referring to 1 or more cells.

All the following are Ranges
  • A1
  • A1:A10
  • I:J
  • 1:5
  • A1, A3, B2:B5,C3:E9,I:J



This : (colon) is a shortcut to select all cells from first to last first:last

I:J selects all rows in columns I and J

1:5 selects all columns in rows 1 through 5

and the final one above selects a number of cells.

Step through the following macro to see what the code does or enter each statement to the

Immediate Window Ctrl G

Range("A1") = 5

Range("A1:A10") = "Hi"

Range("I:J").Interior.Color = vbRed

Range("1:5").Interior.Color = vbYellow

Range("A1, A3, B2:B5,C3:E9,I:J").Select


blog comments powered by Disqus