+ Reply to Thread
Results 1 to 4 of 4

How to use R[#] C[#] in VBA?

  1. #1
    Registered User
    Join Date
    04-28-2016
    Location
    USA
    MS-Off Ver
    office 365
    Posts
    26

    How to use R[#] C[#] in VBA?

    Hello all,

    I am having an issue making a VBA code that converts units of measurements.

    Please Login or Register  to view this content.
    I want to change my code where instead of the cell location is in this form "R[-2]C[-21]" but instead this from "G4"

    Thanks,

    Ehizzle

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: How to use R[#] C[#] in VBA?

    Instead of the .formular1c1 property, use the .formula property (help file with links to these and other properties of the range object https://msdn.microsoft.com/en-us/lib.../dn301006.aspx ). Though, before you abandon r1c1 notation, I will note that there are advantages to using r1c1 notation when working in VBA, which, I expect, is why the macro recorder prefers to record macros using the .formular1c1 property.

    I would note that, in cell AB16, R[-2]C[-21] does not refer to G4, but refers to G14. Syntactically, it doesn't matter, just to be sure that you are clear what cell you want the formula to refer to.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How to use R[#] C[#] in VBA?

    Try changing this

    Please Login or Register  to view this content.
    to this

    Please Login or Register  to view this content.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    04-28-2016
    Location
    USA
    MS-Off Ver
    office 365
    Posts
    26

    Re: How to use R[#] C[#] in VBA?

    Special-K,

    This solved my issue! Thank you very much sir!

    -Ehizzle

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1