rollingzep
Board Regular
- Joined
- Nov 18, 2013
- Messages
- 223
- Office Version
- 365
- Platform
- Windows
Hi,
In my Excel workbook, I have a column BA called Sec which contains various values.
I have another column AH, which is product description.
I use VBA for coding. Among other values of Sec, for one particular value, "BARD" it has to be replaced by the value in product description column.
The col AG is product.
How to get the values of AH into BA for that specific row. I mean it has to copy and paste the value of AH of that row to the row in BA.
TIA
In my Excel workbook, I have a column BA called Sec which contains various values.
I have another column AH, which is product description.
I use VBA for coding. Among other values of Sec, for one particular value, "BARD" it has to be replaced by the value in product description column.
The col AG is product.
VBA Code:
LastRow = ws.Range("AG" & Rows.Count).End(xlUp).Row
For i=2 To LastRow
If ws.Range("BA" & i).Value = "BARD" Then
ws.Range("BA" & i).Value = .................................. ' (copy and paste the value of AH)
End If
Next i
How to get the values of AH into BA for that specific row. I mean it has to copy and paste the value of AH of that row to the row in BA.
TIA