BUSCAR ULTIMO

17/11/2004 - 19:49 por Mario Lopez | Informe spam
HOLA:

QUISIERA SABER SI ALGUIEN PUEDE AYUDARME, TENGO UN LISTADO DE AUTOS, DE
LOS CUALES DESEO SABER EL ULTIMO PRECIO DE COMPRA.

EN UNA TABLA TENGO UN LISTADO POR TIPO DE AUTO Y EN OTRA TABLA TENGO LAS
COMPRAS DE AUTOS DEL AÑO, PERO NECESITO QUE ME PONGA EN EL LISTADO DE TIPOS
DE AUTOS EL ULTIMO PRECIO DE COMPRA.

OJALA ALGUIEN PUEDA AYUDARME

GRACIAS.

Preguntas similare

Leer las respuestas

#1 KL
17/11/2004 - 20:50 | Informe spam
"Mario Lopez" wrote in message
news:
HOLA:

QUISIERA SABER SI ALGUIEN PUEDE AYUDARME, TENGO UN LISTADO DE AUTOS, DE
LOS CUALES DESEO SABER EL ULTIMO PRECIO DE COMPRA.

EN UNA TABLA TENGO UN LISTADO POR TIPO DE AUTO Y EN OTRA TABLA TENGO
LAS
COMPRAS DE AUTOS DEL AÑO, PERO NECESITO QUE ME PONGA EN EL LISTADO DE
TIPOS
DE AUTOS EL ULTIMO PRECIO DE COMPRA.

OJALA ALGUIEN PUEDA AYUDARME

GRACIAS.


Respuesta Responder a este mensaje
#2 David
17/11/2004 - 21:37 | Informe spam
Hace algún tiempo desarrollé este macro para agrupar
datos similares. Creo que en tu caso te va a servir.

Primero, aquí te va el código:

Sub AgruparSimilares4()
' AGRUPA SIMILARES
' Creado el __/12/2002 por David García

Dim Texto1, Texto2 As String
Dim i, nd, Ifila, Icolumna, ffila, fcolumna, sfila,
scolumna As Integer

ActiveSheet.Outline.SummaryRow = xlAbove

Texto1 = ActiveCell.Value
Ifila = ActiveCell.Row
Icolumna = ActiveCell.Column
i = 0

Do While i = 0
ActiveCell.Offset(1, 0).Range("A1").Activate
Texto2 = ActiveCell.Value
If Len(Texto2) > 0 Then
If Texto2 = Texto1 Then
nd = nd + 1
Else
If nd > 0 Then
ffila = ActiveCell.Row
fcolumna = ActiveCell.Column
Range(Cells(Ifila + 1, Icolumna), Cells
(ffila - 1, Icolumna)).Select
ActiveSheet.Outline.SummaryRow = xlAbove
Selection.Rows.Group
Range(Cells(ffila, Icolumna), Cells
(ffila, Icolumna)).Select
Ifila = ffila
nd = 0
Texto1 = Texto2
Else
Ifila = ActiveCell.Row
Texto1 = Texto2
End If
End If
Else
i = 1
If nd > 0 Then
ffila = ActiveCell.Row
fcolumna = ActiveCell.Column
Range(Cells(Ifila + 1, Icolumna), Cells
(ffila - 1, Icolumna)).Select
ActiveSheet.Outline.SummaryRow = xlAbove
Selection.Rows.Group
Range(Cells(ffila, Icolumna), Cells(ffila,
Icolumna)).Select
Ifila = ffila
nd = 0
End If
End If
Loop
ActiveSheet.Outline.ShowLevels RowLevels:=1
End Sub


y aquí lo que te sugiero que hagas:

Primero, te sugiero trabajar en una copia de tus datos.

Segundo, ordena tu listado por código de vehículo
ascendentemente + por fecha descendentemente.

Tercero, te colocas en el primer código de vehículo de tu
lista, y ejecutas el macro.

Cuarto, el macro te va a agrupar tus datos, y te va a
dejar en pantalla la fecha más reciente y el precio más
reciente. Seleccionas todo tu listado, ejecutas Edición -
Ir a - Especial - Sólo celdas visibles, copias lo que te
quede en pantalla y lo pegas en otra hoja.

Quinto, El listado que te queda, lo puedes copiar a tu
libro original, y utilizarlo como base para una función
vlookup o Match, y así, asociar a un vehículo el último
precio.

Pruébalo.

HOLA:

QUISIERA SABER SI ALGUIEN PUEDE AYUDARME, TENGO UN


LISTADO DE AUTOS, DE
LOS CUALES DESEO SABER EL ULTIMO PRECIO DE COMPRA.

EN UNA TABLA TENGO UN LISTADO POR TIPO DE AUTO Y EN


OTRA TABLA TENGO LAS
COMPRAS DE AUTOS DEL AÑO, PERO NECESITO QUE ME PONGA EN


EL LISTADO DE TIPOS
DE AUTOS EL ULTIMO PRECIO DE COMPRA.

OJALA ALGUIEN PUEDA AYUDARME

GRACIAS.


.

email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida