morning all,
simple issue that escapes me at the moment...
returns an application defined or object defined error on 'ActiveCell.Value = cstring'
i know i've used similar code before but cannot get the activecell to populate with cstring.
any suggestions?
thanks in advance.
regards,
longhair
simple issue that escapes me at the moment...
Code:
Dim counter As Integer
Do Until counter = 20
counter = counter + 1
astring = ActiveCell.Value
bstring = ""
If astring Like ("*B1M") Or astring Like ("*B5M") Then _
bstring = Mid(astring, 1, (Len(astring) - 4))
If astring Like ("*B100") Or astring Like ("*B500") Then _
bstring = Mid(astring, 1, (Len(astring) - 5))
If bstring > "" Then
cstring = "=vlookup(" & bstring & ", Sheet1!last, 2, false)"
ActiveCell.Offset(rowoffset:=0, columnoffset:=6).Activate
ActiveCell.Value = cstring
ActiveCell.Offset(rowoffset:=1, columnoffset:=-6).Activate
Else: ActiveCell.Offset(rowoffset:=1, columnoffset:=0).Activate
End If
Loop
i know i've used similar code before but cannot get the activecell to populate with cstring.
any suggestions?
thanks in advance.
regards,
longhair