Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Recorrer columnas a la izquierda para mi macro

publicado

Estimados,

Logre hacer un código para poder agrupar mis datos, pero solo lo he conseguido realizar para la columna : "J"

Y lo que no he podido realizar es colocar un Activecell.offset, para que me identifique la columna anterior, y vuelva a correr la formula.

En caso haya una forma más abreviada para mi macro seria de gran ayuda.

Adjunto el archivo con la macro realizada.

CORRER COLUMNAS A LA IZQUIERDA.zip

Featured Replies

publicado
  • Autor

Logre escribir este código, donde me están corriendo correctamente las columnas, pero aún tengo algunas fallas técnicas, creo que es con la variable Boolean.

--------------------------------

Sub AGRUPON()

Dim Inicio As Integer

Dim Final As Integer

Dim Auxiliar As Integer

Dim A, B As Integer

Dim FinDatos As Boolean

Dim TotalFilas As Double

Dim num As String

FinDatos = False

Auxiliar = 1

A = Auxiliar

Inicio = 1

num = 3

Range("F16").End(xlDown).Select

TotalFilas = ActiveCell.Row

'Range("J3806").Select

For Col = 0 To 11

For x = 1 To TotalFilas

Range("A1").Offset(0, Col).Value = num

num = num + 1

Letra = Letra_Columna(num)

For A = Inicio To TotalFilas

If Range(Letra & Trim(Str(A))).Value = "Resultado" Then

Inicio = A + 1

Exit For

End If

Next A

If Inicio = TotalFilas Then Exit Sub

For B = Inicio To TotalFilas

If Range(Letra & Trim(Str(B))).Interior.ColorIndex <> 42 Or Range(Letra & Trim(Str(B))).Borders.LineStyle <> 1 Then

If Range(Letra & Trim(Str(B))).Borders.LineStyle <> 1 Then FinDatos = True

Final = B - 1

Exit For

End If

Next B

If Inicio <> TotalFilas And Final <> 0 Then

Rows(Trim(Str(Inicio)) & ":" & Trim(Str(Final))).Select

Selection.Rows.Group

Inicio = Final + 1

End If

If FinDatos=True Then Exit For

Next x

Next Col

fin:

End Sub

-----------------------------------------------------------------------------------

Function Letra_Columna(ByVal Col As Long) As String

Letra_Columna = Replace$(Cells(1, Col).Address(False, False), "1", "")

End Function

--------------------------------------------------

Archivado

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.