+ Reply to Thread
Results 1 to 5 of 5

Range with R1C1 format

  1. #1
    Registered User
    Join Date
    11-08-2008
    Location
    HK
    Posts
    12

    Range with R1C1 format

    Why can't I use the following formula in VB? How can this be solved?
    Please Login or Register  to view this content.
    It seems to me that we can't use R1C1 expression in range. Anyway to go around it?
    Last edited by one8421; 01-23-2009 at 03:17 AM.

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Please wrap your code in CODE tags per the forum rules. And there is nothing wrong with the code you posted above; it can be used in VBA.

    Jason

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I have added code tags, make sure you read & follow the forum rules in future.

    There's nothing wrong with your posted code.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Whilst the code you posted normally works I have seen several cases were it was necessary to add the Address command to the Cell command


    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi

    You have unqualified sheet references which will cause you problems if the Activesheet is different from Sheet1. You need:

    Please Login or Register  to view this content.
    Note the periods (.) before the Cells().

    Richard
    Richard Schollar
    Microsoft MVP - Excel

+ 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