Defining data series for bubble chart

stephj

New Member
Joined
Aug 5, 2011
Messages
4
Hi all,

I'm trying to make a macro for making a bubble chart where the columns that are used for the data are dependent on the header in the top row. I have code that will work with defined colums, and code to determine which columns are wanted (both below and working fine) but I don't know how to use the different columns each time the code is run, as I seem to have ended up with cell references in different formats. Any help would be greatly appreciated.

Code for making the bubble chart with data from defined columns.
Code:
    With ActiveSheet.ChartObjects.Add _
            (Left:=100, Width:=600, Top:=200, Height:=500)
            .Chart.ChartType = xlBubble
            .Chart.SetSourceData Source:=Range( _
        "'data'!$B:$B,'data'!$H:$H,'data'!$O:$O")

Code for finding which column is desired:
Code:
Do While Cells(1, i).Value <> False
    If Cells(1, i).Text = "Start date" Then intStartDateRow = i
    i = i + 1
Loop

(Using Excel 2007 on Windows 7)
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
All I think I need is a way of making a bubble chart using cell references instead of range. Does anyone know how to do this please? (Although any other way would be great too!)
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,865
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top