I created a loop that will get the value of one cell to another cell under the same sheet. The expected result should be this, if the loop runs it will get the 1st value then run my created procedure next overwrite the same cell get the 2nd value then execute again my created procedure then get 3rd value .. overwrite the cell ..exec proc and so on ... But my codes only get the last value of the selection.
Public Sub SpecNum()
Dim lrow As Long
Range("A2").Select
lrow = Selection.End(xlDown).Row
For x = 2 To lrow
Range("C2").Value2 = Cells(x, 1).Value2
Next x
Number
End Sub
Public Sub Number()
Dim SpecNum, pref, lastCell As String
Dim lrow As Long
SpecNum = Range("C2").Value2
For x = 2 To 6
Worksheets("Sheet3").Select
pref = Cells(x, "E").Value2
Cells(x, "C").Value2 = SpecNum & pref
Range("C2", Range("C2").End(xlToRight).End(xlDown)).Copy
Next x
Worksheets("Sheet1").Select
Range("A250").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
End Sub
output when moving the number inside the loop.. it doubled/tripled the values
expected result: