ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with correct syntax please (https://www.excelbanter.com/excel-programming/449451-need-help-correct-syntax-please.html)

Living the Dream

Need help with correct syntax please
 
Hi all

I have the following that does what it is supposed to.

For Each PoNo In OutRng
If PoNo = "" Then Exit Sub
Set PoNoFound = InRng.Find(What:=PoNo, After:=lastCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

If Not PoNoFound Is Nothing Then
PoNoFound.Offset(0, 14).Value = PoNo.Offset(0, 7).Value
End If
Next

But! I have been asked to trim off the leading string value and only retain the last 3 only.


For Each PoNo In OutRng
If PoNo = "" Then Exit Sub
Set PoNoFound = InRng.Find(What:=PoNo, After:=lastCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

If Not PoNoFound Is Nothing Then
PoNoFound.Offset(0, 14).Value = Left((PoNo.Offset(0, 7)), 3).Value
End If
Next

But it does not like "Left((PoNo.Offset(0, 7)), 3).Value" stating ""Object required"

Appreciate any assistance, as always:

Heaps of thanks in advance
Mick.

Claus Busch

Need help with correct syntax please
 
Hi Mick,

Am Mon, 4 Nov 2013 00:40:53 -0800 (PST) schrieb Living the Dream:

PoNoFound.Offset(0, 14).Value = Left((PoNo.Offset(0, 7)), 3).Value


try:
PoNoFound.Offset(0, 14).Value = Right(PoNo.Offset(0, 7), 3)


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Living the Dream

Need help with correct syntax please
 
Hi Claus

I am such a nuff, the obvious obscuring of the "Forest through the Trees" came into play big-time...

Thanks heaps for clarifying.

Regards
Mick.


All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com