mejorar proceso de distribucion de datos numericos

dragonfire33

Board Regular
Joined
Oct 7, 2021
Messages
52
Office Version
  1. 365
Platform
  1. Windows
hola buenas como puedo modificar el siguiente proceso:
1. necesito seleccionar 40 celdas de un dicho rango en mi caso seria "a1:h5"
2. enviar esos datos automaticamente a la hoja2 en forma ordenada como se muestra en la columna M
3. necesito eliminar algunos datos numericos de la columna M ( a veces 1 o mas ) y agregar esa misma cantidad con el fin de que sean 40 datos numericos en mi caso elimine el numero en la celda m2 y agregue un nuevo numero en la celda m42
4.agrupar los datos actuales como se muestra en en rango "c1:j5" y enviar a hoja 1 al rango "a1:h5" nuevamente
VBA Code:
Sub unir_columnas()
'Por.DAM
ci = Columnas("A"). Columna 'columna inicial a unir
cf = Columnas("J"). Columna 'columna final a unir
cd = Columnas("M"). Columna 'columna unión
f = 1 'fila inicial de datos
Para i = ci A cf
uf = Celdas(Rows.Count, i). Fin(xlUp). Fila
ud = Celdas(Rows.Count, cd). Fin(xlUp). Fila + 1
 Rango(Celdas(f, i), Celdas(uf, i)). Copiar celdas (ud, cd)
próximo
Fin sub

Sub unirGrup()
'---- Variables modificables:
'=== JHON, modifica estos datos de acuerdo a tu planilla:
IniCol = " A1" 'celda inicial donde están los números a distribuir
IniDes = "C1" ' primera celde donde iniciar los grupos
Gruposde = 5 ' cantidad de elementos de cada grupo

'variables de ---- fin
'
'---- inicio de rutina:
'

UltFila = Rango(IniCol). End(xlDown). Fila

Do While Range(IniCol). Offset(LaFila). Fila <= UltFila
 Rango (IniCol). Offset(LaFila), Range(IniCol). Offset(LaFila + Gruposde - 1)). Rango de copia (IniDes). Offset(0, LaColumna)
    LaFila = LaFila + Gruposde
    LaColumna = LaColumna + 1
Bucle

MsgBox "Fueron distribuidos" & UltFila - Range(IniCol). Fila + 1 & " números en " & LaColumna & " columnas"
Fin sub
[/CÓDIGO] [/CÓDIGO]
 

Attachments

  • 1.png
    1.png
    135.8 KB · Views: 17
  • 2.png
    2.png
    126.3 KB · Views: 17

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,214,814
Messages
6,121,711
Members
449,049
Latest member
THMarana

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