indi visual
Member
Got a little stuck..
Function addStuffOnString(ByVal C As Range) returns the right value back (just in the wrong column).
Not sure if it's the function doing this or the Sub once it returns back.
As line 11 beneath indicates, I want the values to populate Column B (with Col A originally intact).
For some reason, the newly returned data keeps overwriting the original values in Column A (leaving nothing in Col B).
They won't offset over there in Col B for some reason?
Function addStuffOnString(ByVal C As Range) returns the right value back (just in the wrong column).
Not sure if it's the function doing this or the Sub once it returns back.
As line 11 beneath indicates, I want the values to populate Column B (with Col A originally intact).
For some reason, the newly returned data keeps overwriting the original values in Column A (leaving nothing in Col B).
They won't offset over there in Col B for some reason?
Code:
Sub mySubName()
Dim c As Range
Dim myRange As Range
Range("A1") = "OrigVal1"
Range("A2") = "OrigVal2"
Range("A3") = "OrigVal3"
Set myRange = Range("A1:A3")
For Each c In myRange.Cells
c.Offset(0, 1).Value = addStuffOnString(c)
Next c
End Sub
Function addStuffOnString(ByVal c As Range)
c.Value = c.Value + " ..Appended To String (this should be in Col B)"
End Function