• Cell Referencing (XP)

    Author
    Topic
    #445186

    I have just been looking at some code behind an Excel card game simulation where all cell references were in the form:

    [E1]=3, [H22]=65 etc which certainly simplifies the code. There was not a single instance of ‘Range(“E1”).value’ etc. Are there any drawbacks to using this method of cell referencing?

    Regards

    Viewing 0 reply threads
    Author
    Replies
    • #1078800

      You can use [E1] and Range(“E1”) interchangeably, but there are a few things to watch for:
      1) If you define a constant, variable, procedure or function named E1, Excel will not interpret [E1] as a range any more, but as reference to that constant or …
      2) The notation Range(…) allows you to use an expression, e.g.

      Dim n As Long
      n = …
      Range(“E” & n) = 37

      You cannot do that with the [E1] notation.

    Viewing 0 reply threads
    Reply To: Cell Referencing (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: