Hi, I am usually able to figure out what to do just by searching the forum but I have been going round in circles for the past day and a half with no success.
My worksheet has a ProductCode column (B) that needs to be filled with a specific Internal Code that is input by the user. Once the user inputs the internal code, the script needs to append a suffix (.5555) to this input then replace the current content in the cell. It should do this for every row in column (B).
BEFORE
AFTER
I have gotten the following code to work on the active cell but I cannot get it to repeat all the way to the bottom.
I want to call it as part of a larger script that reformats the current report to a new format, therefore it needs to work when cell B2 is not the active cell.
Any help will be greatly appreciated.
My worksheet has a ProductCode column (B) that needs to be filled with a specific Internal Code that is input by the user. Once the user inputs the internal code, the script needs to append a suffix (.5555) to this input then replace the current content in the cell. It should do this for every row in column (B).
BEFORE
FolioNo | ProductCode | Price |
---|---|---|
1 | Breach | 24.50 |
2 | Osco | 12.65 |
3 | Ballen | 45.00 |
AFTER
FolioNo | InternalCode | Price |
---|---|---|
1 | Troy.5555 | 24.50 |
2 | Troy.5555 | 12.65 |
3 | Troy.5555 | 45.00 |
I have gotten the following code to work on the active cell but I cannot get it to repeat all the way to the bottom.
VBA Code:
Private Sub InputProduct()
Dim myValue As Variant
myValue = InputBox("Enter Product Name")
Range("B2").Value = myValue
ActiveCell.Value = ActiveCell.Value & ".5555"
End Sub
I want to call it as part of a larger script that reformats the current report to a new format, therefore it needs to work when cell B2 is not the active cell.
Any help will be greatly appreciated.