![]() |
crear un grafico selectivo hola tengo una planilla en excel con clientes y quiero crear una macro en la cual pueda seleccionar los clientes desde una combobox, insertarlos en una listbox y luego apretar un commandutton y me selecione las columnas: nombre, cantidad de tickets, subtotal y la meta y me las grafique en columnas Nº de unidad de negocio Nombre Cantidad de tickets Monto a cobrar Comisión Condiciones con la empresa Subtotal meta objetivo 78 esteban fernandez 200 10000 1500 150 8350 5000 5000 33 carlos estevez 200 10000 1500 150 8350 5000 5000 23 mauricio 600 60000 9000 600 50400 6000 6000 89 pablin 500 50000 7500 150 42350 25000 25000 44 salvador 125 15000 4200 100 10700 7500 7500 22 fabian 100 30000 8400 200 21400 12000 12000 45 andres 150 20000 3000 200 16800 6000 6000 25 carlos 200 10000 1500 150 8350 5000 5000 algo he hecho pero el problema es que no me acepta matrices para poder ingresar las direcciones de las celdas, les dejo el formulario que hice si pueden ayudenme con las variables a ver si acepta algun formato para que me las pueda graficar, y en todo caso si no pueden ayudarme con eso fijense que tipo de macro puede hacer lo que les dije al principio, este es el formulario. Option Explicit Dim matriz4 As Variant Dim matriz3 As Variant Dim matriz2 As Variant Dim matriz1 As Variant Private Sub ComboBox1_Change() End Sub Private Sub CommandButton1_Click() ListBox1.AddItem ComboBox1.Text Cells.Find(what:=ComboBox1.Text, after:=ActiveCell, LookIn:=xlFormulas, lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlNext, MatchCase:=False).Activate matriz1 = ActiveCell.Address matriz2 = ActiveCell(1, 2).Address matriz3 = ActiveCell(1, 3).Address matriz4 = ActiveCell(1, 4).Address TextBox1 = matriz1 TextBox2 = matriz2 TextBox3 = matriz3 TextBox4 = matriz4 End Sub Private Sub CommandButton2_Click() Cells End Sub Private Sub CommandButton3_Click() Charts.Add ActiveChart.ChartType = xlColumnClustered ' esta es la linea donde tengo el problema porque no me acepta las varialbles en range ActiveChart.SetSourceData Source:=Sheets("hoja1").Range(matriz1, matriz2, matriz3), PlotBy:=xlColumns ActiveChart.Location Where:=xlLocationAsObject, Name:="hoja1" End Sub Private Sub ListBox1_Click() End Sub Private Sub TextBox1_Change() End Sub Private Sub TextBox2_Change() End Sub Private Sub UserForm_Activate() Range("b11").Select Do While ActiveCell <> Empty ComboBox1.AddItem ActiveCell ActiveCell.Offset(1, 0).Select Loop End Sub Private Sub UserForm_Click() End Sub De funcionar seria una muy interesante aplicacion por eso les pido ayuda |
| La zona horaria es GMT -6. Ahora son las 20:56. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.