Check values of a cell and insert data according to that value

0

I'm doing a quote in excel with vba. I have a concern with the following: I need by means of a macro, get me to verify the value of a cell or cells (depending on how many data have been inserted) and then rectify that value in another sheet of the same excel book and insert this information to another new sheet. The value to verify is the code found in cell L17.

Then, the verification is done on this sheet, and since it is the same number inserted in the quote sheet, I can extract the values from the cells that have an (X) and can insert it into another new sheet. These values refer to weight, height, width and length (the data are found vertically, by rows) and are obtained by the VLOOKUP function. The numbers in row D refer to the row number where the equipment values are located (in another sheet of the same book).

From this sheet, all the values of the equipment are extracted.

I hope I could be clear with my concern.

I share the macro that I have for now. It allows me to insert in a new sheet the data of team 1, but because I assigned it in the macro. Select each value and paste it on the new sheet, one by one.

Sub Macro10 ()

'Selección de cada valor, copiar y pegar en otra hoja

Sheets("KITN").Select
Range("E3:E6").Select
Selection.Copy
Sheets("DHL").Select
Range("H17").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A16").Select

Sheets("KITN").Select
Range("I3:I6").Select
Selection.Copy
Sheets("DHL").Select
Range("H18").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A16").Select

Sheets("KITN").Select
Range("J3:J6").Select
Selection.Copy
Sheets("DHL").Select
Range("H19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,SkipBlanks:=_
False, Transpose:=True
Range("A16").Select

Sheets("KITN").Select
Range("K3:K6").Select
Selection.Copy
Sheets("DHL").Select
Range("H20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A16").Select

Sheets("KITN").Select
Range("L3:L6").Select
Selection.Copy
Sheets("DHL").Select
Range("H21").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A16").Select

Sheets("KITN").Select
Range("M3:M6").Select
Selection.Copy
Sheets("DHL").Select
Range("H22").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A16").Select

Sheets("KITN").Select
Range("O3:O6").Select
Selection.Copy
Sheets("DHL").Select
Range("H23").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A16").Select

Sheets("KITN").Select
Range("P3:P6").Select
Selection.Copy
Sheets("DHL").Select
Range("H24").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A16").Select
End Sub

The result is as follows: I inserted all the values corresponding to the equipment 1.    Thanks.

    
asked by Jhon Martinez 31.05.2018 в 06:30
source

0 answers