Hi everybody,
I got a set of prices in column A, and another set on column B. I needed the initial prices in column A equal or lower to the final prices in column B, for each row. Not long ago I found this one-module macro in another forum:
Sub UpdateHighestPrices()
Dim LLoop As Integer
Dim Lrows As Integer
Dim LQuote As String
Dim LHighestVal As String
'Update first 200 rows in spreadsheet with highest prices
Lrows = 2000
LLoop = 2
'Check first 200 rows in spreadsheet
While LLoop <= Lrows
LQuote = "B" & CStr(LLoop)
LHighestVal = "A" & CStr(LLoop)
'Update value in column b, if value in column B is higher
If Range(LQuote).Value < Range(LHighestVal).Value Then
Range(LHighestVal).Value = Range(LQuote).Value
End If
LLoop = LLoop + 1
Wend
MsgBox "Prices are now updated"
End Sub
The macro works great, but now I'm facing a new challenge: I need to compare 10 sets of prices in this way:
-Columns A to J contain initial prices.
-Columns K to T contain final prices.
-I need the same price adjustment, but the comparison should be column A to K, B to L, C to M and so on.
Any ideas of how I should modify the code in order to get this multiple price adjustment?
Bookmarks