A ver, para no estar adivinando o caminando a ciegas por el problema, vamos a ir a lo seguro: 1º: Indicas en la columna B: "Aquí iría la fórmula". Bien, pues te sugiero que introduzcas a mano, en B3:B10 cuáles son los resultados que esperas en cada celda, y expliques cómo y/o por qué se llega a ellos. 2º: Aclara un poco esos significados de 'Factor común 1' y 'Variable por pesos o centavos', para entender cómo juegan en las diferentes resoluciones. 3º: También sería interesante saber cómo interpretar eso de 'ojito al tema porque estos importes entre archivos pueden variar entre el 10% mayor o menor al importe pago'. Para verlo claro, introduce algún ejemplo que fuerce esa diferencia y explica cómo hay que contemplarlo y en qué interfiere para la/s fórmula/s de la columna B. 4º: Y por último, elimina (suprime) todos los datos innecesarios para componer el resultado que buscamos: por ejemplo, ese 'Íd. crédito' de la columna A, ¿aporta algo? ¿No? Pues bórralo. Ídem de lo mismo para 'Nombre' (si no se necesita, bórralo también). Veo que las columnas L y N tienen los mismos contenidos. ¿Por qué no eliminamos una de ellas? Todo lo que sea limpiar la pizarra de garabatos innecesarios, será bienvenido y agradecido. Saludos,
Por
Victor7 , · publicado el 13 de junio 13 jun
Buenas tardes tengo una macro que me separa archivos .csv en columnas, me los importa y los separa de forma automática, la duda es que con unos archivos me lo realiza sin ningún problema y con otros teóricamente iguales no me hace la separación al ser importados.
El código que utilizo, es el siguiente
Sub CARGAR_ESR_CMMS()
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\GUILLERMO\PANEL LEAN\TOMA DE DATOS\export EmergencyServiceEvent.csv" _
, Destination:=Range("$A$1"))
.Name = "export EmergencyServiceEvent"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
Con el segundo código no me funciona aunque es un copia pega, aquí pongo lo pongo
Sub CARGAR_TRABAJOS_CMMS()
Range("CH1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("CH1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\GUILLERMO\PANEL LEAN\TOMA DE DATOS\export Labor.csv", _
Destination:=Range("$CH$1"))
.Name = "export Labor"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
El archivo que no me separa pesa mucho y no se como subirlo, no me importa mandarlo de otra forma, espero vuestros comentarios
Muchas Gracias, De antemano, espero que alguien me pueda ayudar y explicar el motivo
EXPORTAR TRABAJOS.7z