Hi,
I'm in need of a way to convert data from each row to an item number, I have attached an example of a what I'm currently using but I need it the exact opposite.
The code below is writing 39.3, 51, 31, 7 each time there is MPG-PB01, but I need the opposite which is to write MPG-PB01 each time there is 39.3, 51, 31, 7
Dim c As Range, lr As String 'declare variables
lr = Range("D6555").End(xlUp).Row 'set Lr equal to the last cell in column D that contains a value
For Each c In Range("D1:D" & lr).Cells 'loops through cell in column D from row 1 to the last row
Select Case c.Value 'if the current cell in the loop's value is...
Case "MPG-PB02" 'MPG-PB02 then (this is case sensitive)
Range(Cells(c.Row, 5), Cells(c.Row, 8)).Value = Array(44, 42, 26, 9) 'with column E through H spread the array
Case "MPG-PB01"
Range(Cells(c.Row, 5), Cells(c.Row, 8)).Value = Array(39.3, 51, 31, 7)
Case "MPS006"
Range(Cells(c.Row, 5), Cells(c.Row, 8)).Value = Array(31, 27, 24, 7)
Case "MPS007"
Range(Cells(c.Row, 5), Cells(c.Row, 8)).Value = Array(32, 30, 24, 8)
Case "MPS008"
Range(Cells(c.Row, 5), Cells(c.Row, 8)).Value = Array(32, 28, 24, 7)
End Select
Next c 'move to next cell in the loop
And I'm using excel 2003
Hope this makes sense and that somebody can help.
Thanks anyway,
David
Bookmarks