I have been trying to piece together a functional workbook, making use of VBA code as I go.
I currently have a macro created that looks at a dynamic range of values in a column, and converts them to a new value.
Sub ConvertWireSize()
Dim i As Long
Sheets("Circuits").Select
Range("H1").Select
For i = 1 To Rows.Count
If Cells(i, 8).Value = 0.5 Then
Cells(i, 8).Value = 20
ElseIf Cells(i, 8).Value = 0.8 Then
Cells(i, 8).Value = 18
ElseIf Cells(i, 8).Value = 1 Then
Cells(i, 8).Value = 16
ElseIf Cells(i, 8).Value = 2 Then
Cells(i, 8).Value = 14
ElseIf Cells(i, 8).Value = 3 Then
Cells(i, 8).Value = 12
ElseIf Cells(i, 8).Value = 5 Then
Cells(i, 8).Value = 10
ElseIf Cells(i, 8).Value = 8 Then
Cells(i, 8).Value = 8
ElseIf Cells(i, 8).Value = 13 Then
Cells(i, 8).Value = 6
ElseIf Cells(i, 8).Value = 19 Then
Cells(i, 8).Value = 4
End If
Next i
MsgBox "Wire Size Has Been Converted From CSA to AWG."
Sheets("Main").Select
End Sub
This seems to be a very inefficient, and slow, way of doing things.
I've been trying to piece together a new macro that would use VLookup
, but the more research I do, the more confused I get.
Could someone help point me in the right direction?