Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find a Item & Copy the Data

Can someone please help me?

I've got a huge SAP generated Parts List from overseas which I need to find
a unique number in column A. (Sheet1)
There are 10 columns and in excess of 55,000 rows
This SAP Text number is comprised of 18 fixed digits (eg:
000000065202255411).
However the number itself is variable with leading zero's (eg:
000000000063060003), and anything in between if you follow my drift.
My problem is I need to verify each customer's price and purchase cost from
this data sheet.
I've managed to automate most of the process but I can't return the values I
need to verify the data using the VBA find function.

I enter the some basic data via a user form which is copied into a
spreadsheet (Sheet2)
This includes the required item number, minus the leading zero's.
I then want to use this entered number as the trail for finding the number
in the Sap List and copying the required data back into sheet2 and so
creating a filtered list for easy validation.
This is all done manually at the moment.
Am I asking too much?

Alec




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find a Item & Copy the Data


You need to use find with the option lookat:=xlpart. Since the number
may be in the middle of a number you have to strip off the leading
zeroes and check that the number matches like the code below. If you
have a number with leading zeroes it may be a string so you need to use
the VAL function to remove the leading zeroes. Yo also have to use
FindNext becuae the 1st occurance of the number found may not be the one
you are looking for.



FindNum = "0000063060003"
FindNumNoLeading = val(FinNum)

Found = false
set c = columns("A").find(what:=FindNumNoLeading, _
lookin:=xlvalues,lookat:=xlpart)
if not c is nothing then
FirstAddr = c.address
Do
'remove leading zeroes from found number and compare
if Val(c) = FindNumNoLeading then
Found = True
exit Do
end if
set c = columns("A").findnext(after:=c)
loop while not c is nothing and c.address < FirstAddr
end if


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=195154

http://www.thecodecage.com/forumz

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
To find rate of each item from item.xls and to copy price.xls pol Excel Discussion (Misc queries) 7 July 16th 09 12:49 AM
Find and copy data kiml Excel Worksheet Functions 3 April 29th 08 01:15 PM
Find rows with a common item and find or highlight difference jonnybrovo815 Excel Programming 2 February 27th 08 12:56 AM
how do i find multiple matches of one data item in an excel range DivaHouston Excel Discussion (Misc queries) 1 January 7th 08 02:43 PM
Find All and then Copy the Data... Mr B[_3_] Excel Programming 2 April 5th 04 10:09 PM


All times are GMT +1. The time now is 08:55 PM.

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

About Us

"It's about Microsoft Excel"