Results 1 to 5 of 5

Replace filename with variable in "Activecell.FormulaR1C1=" expression

Threaded View

  1. #1
    Registered User
    Join Date
    02-27-2009
    Location
    Perth, W.Australia
    MS-Off Ver
    W. Australia
    Posts
    2

    Replace filename with variable in "Activecell.FormulaR1C1=" expression

    I am new to Excel VBA so excuse me if I am asking a silly question. I have recorded a macro which contains several lines of code like this one:

    ActiveCell.FormulaR1C1 = "='[OCR 14-02-09.xls]sun (2)'!R38C4:R38C5"
    I would like to replace the filename "OCR 14-02-09.xls" with a variable. I have tried several different combos of brackets and quotes but always get an error message. Is this possible?

    Thanks
    pommyb
    Last edited by pommyb; 03-04-2009 at 02:13 AM. Reason: Solved

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