Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default I have two columns (A) and (G) that have like product codes however

I have two columns (A) and (G) that have like product codes however
they are not in any particular order. In columns (H) and ( i ) are bin
numbers that are associated with the product codes in column (G) I
would like to put these bin numbers in columns (E) and (F)
Example of what my worksheet looks like:

Prod Code Item Name Location Qty Prod Code Bin 1 Bin 2
BD0036 Oxygen 10 2 BD0100 25
42
BD0100 Vent 15 16 BD0036 17
64

What I would like for it to look like:

Prod Code Item Name Location Qty Bin 1 Bin 2
BD0036 Oxygen 10 2 17 64
BD0100 Vent 15 16 25 42

I have 20,000 rows and would appreciate any kind of help i can get

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default I have two columns (A) and (G) that have like product codes howev

do you have 20 000 rows in both columns? An easy way would be to use a
vlookup function. But that might take a little bit of time if you have 20
000. If you sorted them then this would make things faster. Or you can
create a find function that will only search the one column (G) with data
from the first column (A). When this is found it could return the two values
needed.

Another thing, does the product code in the first column always have a match
in the second column?

Anyways before you do anything, try sorting it. Because a lot of the
functions will work faster with pre sorted data.

Cheers,
Scott

" wrote:

I have two columns (A) and (G) that have like product codes however
they are not in any particular order. In columns (H) and ( i ) are bin
numbers that are associated with the product codes in column (G) I
would like to put these bin numbers in columns (E) and (F)
Example of what my worksheet looks like:

Prod Code Item Name Location Qty Prod Code Bin 1 Bin 2
BD0036 Oxygen 10 2 BD0100 25
42
BD0100 Vent 15 16 BD0036 17
64

What I would like for it to look like:

Prod Code Item Name Location Qty Bin 1 Bin 2
BD0036 Oxygen 10 2 17 64
BD0100 Vent 15 16 25 42

I have 20,000 rows and would appreciate any kind of help i can get


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default I have two columns (A) and (G) that have like product codes howev


Scott wrote:
do you have 20 000 rows in both columns? An easy way would be to use a
vlookup function. But that might take a little bit of time if you have 20
000. If you sorted them then this would make things faster. Or you can
create a find function that will only search the one column (G) with data
from the first column (A). When this is found it could return the two values
needed.

Another thing, does the product code in the first column always have a match
in the second column?

Anyways before you do anything, try sorting it. Because a lot of the
functions will work faster with pre sorted data.

Cheers,
Scott

" wrote:

I have two columns (A) and (G) that have like product codes however
they are not in any particular order. In columns (H) and ( i ) are bin
numbers that are associated with the product codes in column (G) I
would like to put these bin numbers in columns (E) and (F)
Example of what my worksheet looks like:

Prod Code Item Name Location Qty Prod Code Bin 1 Bin 2
BD0036 Oxygen 10 2 BD0100 25
42
BD0100 Vent 15 16 BD0036 17
64

What I would like for it to look like:

Prod Code Item Name Location Qty Bin 1 Bin 2
BD0036 Oxygen 10 2 17 64
BD0100 Vent 15 16 25 42

I have 20,000 rows and would appreciate any kind of help i can get




No in most cases it does not have a match. Column (A) might have 5,000
product codes with the same product code apearing muliple times
depending on what locations carry that product and column (G) will have
20,000 unique product codes only appearing once.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default I have two columns (A) and (G) that have like product codes howev


wrote:
Scott wrote:
do you have 20 000 rows in both columns? An easy way would be to use a
vlookup function. But that might take a little bit of time if you have 20
000. If you sorted them then this would make things faster. Or you can
create a find function that will only search the one column (G) with data
from the first column (A). When this is found it could return the two values
needed.

Another thing, does the product code in the first column always have a match
in the second column?

Anyways before you do anything, try sorting it. Because a lot of the
functions will work faster with pre sorted data.

Cheers,
Scott

" wrote:

I have two columns (A) and (G) that have like product codes however
they are not in any particular order. In columns (H) and ( i ) are bin
numbers that are associated with the product codes in column (G) I
would like to put these bin numbers in columns (E) and (F)
Example of what my worksheet looks like:

Prod Code Item Name Location Qty Prod Code Bin 1 Bin 2
BD0036 Oxygen 10 2 BD0100 25
42
BD0100 Vent 15 16 BD0036 17
64

What I would like for it to look like:

Prod Code Item Name Location Qty Bin 1 Bin 2
BD0036 Oxygen 10 2 17 64
BD0100 Vent 15 16 25 42

I have 20,000 rows and would appreciate any kind of help i can get




No in most cases it does not have a match. Column (A) might have 5,000
product codes with the same product code apearing muliple times
depending on what locations carry that product and column (G) will have
20,000 unique product codes only appearing once.


create a find function that will only search the one column (G) with
data
from the first column (A). When this is found it could return the two
values
needed.

Could you Elaborate on this a little bit for i am but a rookie

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default I have two columns (A) and (G) that have like product codes ho

Here is an example of what I've used. It's for something similar to what
you're doing. if you can't make heads or tails of it I'll explain it more
later.

sub test
dim tn as long, num as long, i as long, a(1 to 5000, 1 to 5000, 1 to 5000),
' for the following count the smaller of the two ranges and input them into
the array a(i)
tn = Excel.WorksheetFunction.CountA(Range("AT:AT")) - 1 ' <----- change this

range("At1").select
For i = 1 To tn
If ActiveCell.Offset(0, 1) = "" Then
Range(ActiveCell, ActiveCell.Offset(0, 1)).Delete 'in case of blank
cells
i = i - 1
Else
a(1,i) = ActiveCell.Offset(i - 1, 0)
a(2,i) = ActiveCell.Offset(i - 1, 1)
a(3,i) = ActiveCell.Offset(i - 1, 2)
End If
Next i

For i = 1 To tn
Set rng = FindStuff(a(i))
If Not rng Is Nothing Then
rng.Activate
activecell.offset(0,1) = a(2,i) ' <----- change these (just the
offset)
activecell.offset(0,2) = a(3,i)
End If
Next i
end sub


''''' this is the function getstuff

Public Function FindStuff(ByVal strTofind As String) As Range
Dim rngToSearch As Range
Dim wksToSearch As Worksheet

Set wksToSearch = Sheets("Data") '''' <------ change this
With wksToSearch
Set rngToSearch = .Range(.Range("B2"), .Cells(Rows.Count,
"B").End(xlUp)) '''' <------ change this
End With
Set FindStuff = rngToSearch.Find(What:=strTofind, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
MatchCase:=False)
End Function

cheers,
Scott
" wrote:


wrote:
Scott wrote:
do you have 20 000 rows in both columns? An easy way would be to use a
vlookup function. But that might take a little bit of time if you have 20
000. If you sorted them then this would make things faster. Or you can
create a find function that will only search the one column (G) with data
from the first column (A). When this is found it could return the two values
needed.

Another thing, does the product code in the first column always have a match
in the second column?

Anyways before you do anything, try sorting it. Because a lot of the
functions will work faster with pre sorted data.

Cheers,
Scott

" wrote:

I have two columns (A) and (G) that have like product codes however
they are not in any particular order. In columns (H) and ( i ) are bin
numbers that are associated with the product codes in column (G) I
would like to put these bin numbers in columns (E) and (F)
Example of what my worksheet looks like:

Prod Code Item Name Location Qty Prod Code Bin 1 Bin 2
BD0036 Oxygen 10 2 BD0100 25
42
BD0100 Vent 15 16 BD0036 17
64

What I would like for it to look like:

Prod Code Item Name Location Qty Bin 1 Bin 2
BD0036 Oxygen 10 2 17 64
BD0100 Vent 15 16 25 42

I have 20,000 rows and would appreciate any kind of help i can get




No in most cases it does not have a match. Column (A) might have 5,000
product codes with the same product code apearing muliple times
depending on what locations carry that product and column (G) will have
20,000 unique product codes only appearing once.


create a find function that will only search the one column (G) with
data
from the first column (A). When this is found it could return the two
values
needed.

Could you Elaborate on this a little bit for i am but a rookie




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default I have two columns (A) and (G) that have like product codes ho


Scott wrote:
Here is an example of what I've used. It's for something similar to what
you're doing. if you can't make heads or tails of it I'll explain it more
later.

sub test
dim tn as long, num as long, i as long, a(1 to 5000, 1 to 5000, 1 to 5000),
' for the following count the smaller of the two ranges and input them into
the array a(i)
tn = Excel.WorksheetFunction.CountA(Range("AT:AT")) - 1 ' <----- change this

range("At1").select
For i = 1 To tn
If ActiveCell.Offset(0, 1) = "" Then
Range(ActiveCell, ActiveCell.Offset(0, 1)).Delete 'in case of blank
cells
i = i - 1
Else
a(1,i) = ActiveCell.Offset(i - 1, 0)
a(2,i) = ActiveCell.Offset(i - 1, 1)
a(3,i) = ActiveCell.Offset(i - 1, 2)
End If
Next i

For i = 1 To tn
Set rng = FindStuff(a(i))
If Not rng Is Nothing Then
rng.Activate
activecell.offset(0,1) = a(2,i) ' <----- change these (just the
offset)
activecell.offset(0,2) = a(3,i)
End If
Next i
end sub


''''' this is the function getstuff

Public Function FindStuff(ByVal strTofind As String) As Range
Dim rngToSearch As Range
Dim wksToSearch As Worksheet

Set wksToSearch = Sheets("Data") '''' <------ change this
With wksToSearch
Set rngToSearch = .Range(.Range("B2"), .Cells(Rows.Count,
"B").End(xlUp)) '''' <------ change this
End With
Set FindStuff = rngToSearch.Find(What:=strTofind, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
MatchCase:=False)
End Function

cheers,
Scott
" wrote:


wrote:
Scott wrote:
do you have 20 000 rows in both columns? An easy way would be to use a
vlookup function. But that might take a little bit of time if you have 20
000. If you sorted them then this would make things faster. Or you can
create a find function that will only search the one column (G) with data
from the first column (A). When this is found it could return the two values
needed.

Another thing, does the product code in the first column always have a match
in the second column?

Anyways before you do anything, try sorting it. Because a lot of the
functions will work faster with pre sorted data.

Cheers,
Scott

" wrote:

I have two columns (A) and (G) that have like product codes however
they are not in any particular order. In columns (H) and ( i ) are bin
numbers that are associated with the product codes in column (G) I
would like to put these bin numbers in columns (E) and (F)
Example of what my worksheet looks like:

Prod Code Item Name Location Qty Prod Code Bin 1 Bin 2
BD0036 Oxygen 10 2 BD0100 25
42
BD0100 Vent 15 16 BD0036 17
64

What I would like for it to look like:

Prod Code Item Name Location Qty Bin 1 Bin 2
BD0036 Oxygen 10 2 17 64
BD0100 Vent 15 16 25 42

I have 20,000 rows and would appreciate any kind of help i can get




No in most cases it does not have a match. Column (A) might have 5,000
product codes with the same product code apearing muliple times
depending on what locations carry that product and column (G) will have
20,000 unique product codes only appearing once.


create a find function that will only search the one column (G) with
data
from the first column (A). When this is found it could return the two
values
needed.

Could you Elaborate on this a little bit for i am but a rookie


I have no clue to what this means is there a more simple way? I know
how to insert a macros but have no clue on writing one.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default I have two columns (A) and (G) that have like product codes howev

Looking at what your data looks like now, I noticed that the PROD CODE in
column G does not match the PROD CODE in column A. As long as you do not
have duplicate product codes in G, I would sort G accordingly so that the
product code in G will match that in A. Then I would delete column G. This
should bring everything in line, again, providing there are no duplicates nor
empty cells.



" wrote:

I have two columns (A) and (G) that have like product codes however
they are not in any particular order. In columns (H) and ( i ) are bin
numbers that are associated with the product codes in column (G) I
would like to put these bin numbers in columns (E) and (F)
Example of what my worksheet looks like:

Prod Code Item Name Location Qty Prod Code Bin 1 Bin 2
BD0036 Oxygen 10 2 BD0100 25
42
BD0100 Vent 15 16 BD0036 17
64

What I would like for it to look like:

Prod Code Item Name Location Qty Bin 1 Bin 2
BD0036 Oxygen 10 2 17 64
BD0100 Vent 15 16 25 42

I have 20,000 rows and would appreciate any kind of help i can get


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
Querying multiple Product Codes in one field using SUMPRODUCT() Tan New Users to Excel 2 April 15th 07 06:36 PM
I have two columns (A) and (G) that have like product codes however [email protected] Excel Worksheet Functions 1 August 4th 06 08:19 PM
Sum Product if? Three columns gmunro Excel Worksheet Functions 6 August 2nd 06 03:49 PM
How can i have all alike product codes in column A be matched with like cities in column B and then add the totals that are in column C [email protected] Excel Programming 4 August 2nd 06 01:10 AM
Sum product of many pairs of columns KeenKiwi Excel Worksheet Functions 3 May 11th 06 12:59 PM


All times are GMT +1. The time now is 11:10 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"