+ Reply to Thread
Results 1 to 5 of 5

Whats wrong with this code??

  1. #1
    Registered User
    Join Date
    04-13-2006
    Posts
    26

    Whats wrong with this code??

    'Revise Account Name
    Range("Y1").Select
    LastRow = Range("A65536").End(xlUp).Row
    ActiveCell.FormulaR1C1 = "=+RC[-22]&' - '&RC[-20]"
    Selection.AutoFill Destination:=Range("Y2:Y" & LastRow), Type:=xlFillDefault
    Range("Y1").Select
    ActiveCell.FormulaR1C1 = "AccountName"
    Range("A1").Select
    The code trips up on (ActiveCell.FormulaR1C1 = "=+RC[-22]&' - '&RC[-20]")

  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    ActiveCell.FormulaR1C1 = "=+RC[-22] - RC[-20]"
    Best regards,

    Ray

  3. #3
    Registered User
    Join Date
    04-13-2006
    Posts
    26
    Ray,

    This is a workbook formula which combines two cells, (=A1&" - "&A2), it is not a mathematical formula

    Any ideas how i have gone wrong??

  4. #4
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    This seems to work:
    ActiveCell.FormulaR1C1 = "=RC[-22] & " & "-RC[-20]"

  5. #5
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    this worked for me

    Please Login or Register  to view this content.
    Regards,
    Simon

+ 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