+ Reply to Thread
Results 1 to 2 of 2

Breaking out Comma Delimited Fields - VBA Error - "Subscript out of Range"

  1. #1
    Registered User
    Join Date
    02-13-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    1

    Breaking out Comma Delimited Fields - VBA Error - "Subscript out of Range"

    ExpenseReportv1.xlsmI'm getting an error with the following Macro. It's designed to break out comma delimited fields (fields F:R) into separate rows on a second sheet (moving from "Raw Sharepoint Data" to "Format - Level 1"). It works for the first row, but when it moves down to the second row, the macro fails and I get the error "Runtime error '9': Subscript Out of Range". When I open the debugger, it looks like it errors out on the line "rf = arrf(0)" (in red below). The full range of the data is columns A:R, but I've tried extending the range in the macro out as far as A:Z, and I still get the error. Any help would be appreciated.



    Please Login or Register  to view this content.
    Last edited by sev979; 02-13-2014 at 10:20 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Breaking out Comma Delimited Fields - VBA Error - "Subscript out of Range"

    I think the problem might be that rf is an empty string/cell.

    By the way, you've got a lot of variables in that code, pretty sure it could be tidied up a bit.

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    PS Can you add code tags?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-13-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: Breaking out Comma Delimited Fields - VBA Error - "Subscript out of Range"

    Yeah, I will definitely be cleaning up the variables, but as it stands I might have to change which columns I use, and this makes it easier for me to visualize until it's finalized.

    I've attached a file with some sample date below, and added the tags to my above post. I appreciate the help.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find expression causing "Subscript out of range" error
    By aseret in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2013, 12:05 AM
  2. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM
  3. "Subscript out of range" error message when using HPageBreaks.Location
    By Johnny Tong in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-02-2008, 09:35 PM
  4. [SOLVED] "Subscript out of range" error for: Workbooks("Test1.xls").Save
    By Just12341234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2005, 11:05 AM
  5. FileCopy Command Giving "Subscript Out of Range" Error Message
    By Jim Hagan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2005, 02:05 PM

Tags for this Thread

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