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

expertatexcel.com

 


[cur_month_end] - access value in a range name

Excel and VBA have many ways to reference the same thing.

For example, to set the variable a to the value of cell A1 you can:
  • a = Range("A1")
  • a = Cells(1,1)
  • a = ActiveCell ' works if A1 is the active cell
  • a = [A1]
  • a = [a_cell_value_from_a_range_name]  ' works if the range name exists and uses cell A1
  • [A1] = 5

    So the lesson here is to be aware of the "[   ]" characters as someone may be using them in their code.

    Other usages of brackets
  • File names

    See Also:
  • Special Characters

    Excercises

    Set A1 = 5
    go to
    Immediate Window

    ? range("A1")
    ? range(A1)
    ? Activecell
    ? Cells(1,1)






  •