Results 1 to 6 of 6

Convert string to range

Threaded View

  1. #1
    Registered User
    Join Date
    12-17-2010
    Location
    Stockholm
    MS-Off Ver
    Excel 2007
    Posts
    8

    Convert string to range

    Hi all!
    I'm am very new to vba programming and have limited knowledge of excel, which is not a good combination.. =) Anyway, i'm trying to make a chart using a selection of cells. I loop the sheet and add each cell address i want (i'm looking for cells containing a specific word, then grabbing the address of the adjacent cell that contains a number). So i have a string (tmpFull) that looks like this, only longer. Each of these cells contain a number.

    $B$12,$B$13,$B$14,$B$15,$B$16,$B$17,$B$18,$B$19,$B$21,$B$22,$B$27

    I then need to assign this to my chart, so i "convert" the string to a range, or at least i'm trying to, using

    Dim FullRng As Range
    FullRng = tmpFull
    And then add it to my chart (FullDatesRng made the same way)

    With ActiveChart.SeriesCollection.NewSeries
        .Name = "Test"
        .Values = Worksheets("Raw Data").Range(FullRng)
        .XValues = Worksheets("Raw Data").Range(FullDatesRng)
    End With
    But no matter what i do, i end up with a 1004 error. I have tried building the string with different formats like B10,B11 or "B10,B11" and so on in different combinations but nothing works. Hoping for a pointer to what i'm doing wrong here.

    Cheers!
    Last edited by DonkeyOte; 12-17-2010 at 09:11 AM.

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