Saltar al contenido

Codigo vba para crear gráficas dentro de un user form o listbox

publicado

Buenos Dias, Jovenes

Espero me puedan ayudar con algun codigo para crear gráficas dentro de un user form o listbox

Agradecere sus ayuda...

Featured Replies

publicado
  • Autor

Encontre esto pero no logro que me funcione.

Gráfico en una hoja predeterminada:

Sub CrearGrafico()

Worksheets("Hoja1").Shapes.AddChart.Select

ActiveChart.SetSourceData Source:=Range("A1:B6")

End Sub

Gráfica en la hoja activa:

Sub CrearGrafico()

ActiveSheet.Shapes.AddChart.Select

ActiveChart.SetSourceData Source:=Range("A1:B6")

End Sub

Crear una gráfica tipo pastel:

Sub GraficoPastel()

ActiveSheet.Shapes.AddChart.Select

ActiveChart.SetSourceData Source:=Range("A1:B6")

ActiveChart.ChartType = xlPie

ActiveChart.SeriesCollection(1).Name = "Ventas por Categoría"

End Sub

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.