Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing sheets/objects
Hi, I am new to writing macros for excel and have a problem I need some help with: I want to add a chart using data from the active sheet. I tried the code below. I know it's writing the active sheet name to CSheet because I can read it using msgbox so why won't the reference work?? CSheet = ActiveSheet.Name Charts.Add ActiveChart.ChartType = xlXYScatterSmoothNoMarkers ActiveChart.SetSourceData Source:=Sheets("CSheet").Range("C16:D82"), PlotBy _ :=xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:="CSheet" etc.. -- dve11 ------------------------------------------------------------------------ dve11's Profile: http://www.excelforum.com/member.php...o&userid=31618 View this thread: http://www.excelforum.com/showthread...hreadid=513129 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing sheets/objects
Hi DVE11,
Change: Name:="CSheet" to Name:=CSheet --- Regards, Norman "dve11" wrote in message ... Hi, I am new to writing macros for excel and have a problem I need some help with: I want to add a chart using data from the active sheet. I tried the code below. I know it's writing the active sheet name to CSheet because I can read it using msgbox so why won't the reference work?? CSheet = ActiveSheet.Name Charts.Add ActiveChart.ChartType = xlXYScatterSmoothNoMarkers ActiveChart.SetSourceData Source:=Sheets("CSheet").Range("C16:D82"), PlotBy _ :=xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:="CSheet" etc.. -- dve11 ------------------------------------------------------------------------ dve11's Profile: http://www.excelforum.com/member.php...o&userid=31618 View this thread: http://www.excelforum.com/showthread...hreadid=513129 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Referencing between two Excel Workbook Objects | Excel Worksheet Functions | |||
cannot shift objects off sheets | Excel Worksheet Functions | |||
COM Addin for Excel: Despite referencing the Excel Object Library no objects availabl | Excel Programming | |||
MS Dialog 5.0 sheets - Accessing data elements of objects | Excel Worksheet Functions | |||
Preventing compile errors when referencing objects ehanced after 1997 | Excel Programming |