Ultimately I'm trying to go through a range of cell and attach to the left the corresponding return value. I've had some problems with the code in not getting what I want - so I inserted some Msgbox(s) for confirmation.
Code is as follows:
Sub FindCde()
'undernoted 3 lines are in range C3:C5
'xlLine
'xlLineMarkersStacked
'xlLineStacked
Dim cel As Range, Rng As Range
'Dim cde As Long 'causes error
Set Rng = Range("C3:C5")
For Each cel In Rng
cde = cel.Value
'expecting this msg to show "cell_ref" and "constant_number":
MsgBox cel & Space(10) & cde
'this message does return (as expected) "constant_numbers" for the undernoted types:
MsgBox xlLine & Space(5) & xlLineMarkersStacked & Space(5) & xlLineStacked
'ultimately next line should insert the "constant_number" in the cell to the left
'Range("cel").Offset(0, -1).Value = cde
Next
End Sub
Any help would be appreciated.
Thanks.
Code is as follows:
Sub FindCde()
'undernoted 3 lines are in range C3:C5
'xlLine
'xlLineMarkersStacked
'xlLineStacked
Dim cel As Range, Rng As Range
'Dim cde As Long 'causes error
Set Rng = Range("C3:C5")
For Each cel In Rng
cde = cel.Value
'expecting this msg to show "cell_ref" and "constant_number":
MsgBox cel & Space(10) & cde
'this message does return (as expected) "constant_numbers" for the undernoted types:
MsgBox xlLine & Space(5) & xlLineMarkersStacked & Space(5) & xlLineStacked
'ultimately next line should insert the "constant_number" in the cell to the left
'Range("cel").Offset(0, -1).Value = cde
Next
End Sub
Any help would be appreciated.
Thanks.