Excel Una celda para muchas fórmulas (me doy cuenta de que esto puede no ser posible)

Excel Una celda para muchas fórmulas (me doy cuenta de que esto puede no ser posible)

En primer lugar quiero empezar diciendo que sé que esto es extremadamente difícil o imposible.

tengo datos (deWikipedia, en cualquier aeropuerto en la lista de aerolíneas y destinos), en una columna está el nombre de la aerolínea y en la otra hay una lista de destinos separados por comas y ocasionalmente alguna información adicional.

Lo que necesito es colocar cada destino en una fila separada, con el nombre de la aerolínea al lado y la información adicional (chárter, estacional, "comienza...", referencias) en una tercera columna.

Haré esto repetidamente con varias tablas de Wikipedia. Estoy creando un mapa de ruta en Kumu.io. Está bien si cualquier solución no lo hace todo, solo necesito algo cercano ya que no hay manera de que pueda hacerlo todo a mano. Si necesitas más información, házmelo saber. Gracias por cualquier ayuda, este es realmente un recurso increíble.

Los datos están en este formato.

ingrese la descripción de la imagen aquí

Y necesito que se vea como

ingrese la descripción de la imagen aquí

Respuesta1

Su pregunta no está clara si realmente tiene hipervínculos o no (algunos están coloreados, otros están subrayados y otros no)

No tengo idea si esto se puede hacer con funciones de hoja de cálculo, pero este VBa lo hace.

Option Explicit

Sub CrazyAirlines()

'************** There are things you may need to edit here

Dim currentRow As Integer
currentRow = 1 'I assume we start on row 1, if row 1 is actually headings, change this to the first row of data

Dim destinationRow As Integer
destinationRow = 1 ' assuming there is no heading again, if there is, change to a 2

Dim airlineCol As String
airlineCol = "A"

Dim destinationCol As String
destinationCol = "B"

Dim extraCol As String
extraCol = "C"

Dim origSheet As String
origSheet = "Sheet1" ' the name of of the sheet where the values currently live

Dim destSheet As String
destSheet = "Sheet2" ' this is the sheet name where the results will be

' *********** Hopefully you don't need to edit anything under this line!!

Worksheets(destSheet).Cells.Clear

Do While (Worksheets(origSheet).Range(airlineCol & currentRow).Value <> "")

    Dim airline As String
    airline = Worksheets(origSheet).Range(airlineCol & currentRow).Value

    Dim destinations As String
    destinations = Worksheets(origSheet).Range(destinationCol & currentRow).Value

    Dim extraInfo As String

    Dim title As String

    Dim spInfo() As String
    spInfo = Split(destinations, ":")

    If (UBound(spInfo) > 0) Then
        title = spInfo(0)
    End If

    destinations = Replace(destinations, title & ":", "")

    Dim spDest() As String
    spDest = Split(destinations, ",")

    Dim i As Integer

    For i = 0 To UBound(spDest)

        Worksheets(destSheet).Range(airlineCol & destinationRow).Value = RemoveSquare(Trim(airline))

        Dim des As String
        des = RemoveSquare(spDest(i))

        Dim containsExtra() As String
        containsExtra = Split(spDest(i), "(")

        If UBound(containsExtra) > 0 Then
            title = Replace(containsExtra(1), ")", "")
            des = containsExtra(0)
        End If

        Worksheets(destSheet).Range(destinationCol & destinationRow).Value = Trim(des)

        If (title <> "") Then
            Worksheets(destSheet).Range(extraCol & destinationRow).Value = title
            title = "" 'kill it, kaboom, bang, boom (not good words considering this is about airlines, but hilarious
        End If

        destinationRow = destinationRow + 1

    Next i

    currentRow = currentRow + 1
Loop

End Sub

Function RemoveSquare(s As String)

Dim sp() As String
sp = Split(s, "]")

    If UBound(sp) > 0 Then
        RemoveSquare = sp(1)
    Else
        RemoveSquare = s
    End If

End Function

La hoja 1 parecía

ingrese la descripción de la imagen aquí

Y después de ejecutar el VBa anterior, mi Sheet2 parecía

ingrese la descripción de la imagen aquí

información relacionada