Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default 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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CORRECT SYNTAX FOR RUN... [email protected] Excel Programming 3 August 18th 06 09:29 PM
Correct Syntax Ronbo Excel Programming 2 February 21st 06 01:57 PM
Correct VBA syntax Ken G. Excel Discussion (Misc queries) 3 December 7th 05 12:35 AM
If...and... - can never get the syntax correct! Darin Kramer Excel Programming 12 March 24th 05 04:18 PM
Can't get this syntax correct, please help. Sharlene England Excel Programming 4 December 1st 03 05:41 PM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"