Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I have this worksheet that I use to enter invoice information. I am using it to double check the entered invoices and modify any that are incorrect. I don't know how to replace the incorrect record with the corrected one. I can get the info pasted down once I can determine which row it came from. I just don't know how to find the row with the same invoice number (invoice number to be pasted is in named range SI_InvNo. This needs to be found in named range Invoice1) Anybody have an idea? TIA -Minitman |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
you could use the worksheet function MATCH in your VBA code. something like row_number=application.worksheetfunction.match(inv oice_number,range("In voice1"),0) -- Regards Frank Kabel Frankfurt, Germany Minitman wrote: Greetings, I have this worksheet that I use to enter invoice information. I am using it to double check the entered invoices and modify any that are incorrect. I don't know how to replace the incorrect record with the corrected one. I can get the info pasted down once I can determine which row it came from. I just don't know how to find the row with the same invoice number (invoice number to be pasted is in named range SI_InvNo. This needs to be found in named range Invoice1) Anybody have an idea? TIA -Minitman |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Frank,
Thanks for the quick response. I don't quite understand this bit of code. I have two named ranges and you referred to only one. Where do I put "SI_InvNo"? Also what are row_number and invoice_number? And finally, what does the 0 indicate? row_number= _ application.worksheetfunction.match(invoice_number ,range("Invoice1"),0) -Minitman On Wed, 14 Apr 2004 19:35:17 +0200, "Frank Kabel" wrote: Hi you could use the worksheet function MATCH in your VBA code. something like row_number=application.worksheetfunction.match(in voice_number,range("In voice1"),0) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
do you want a VBA solution or a worksheet function. For the first one add the line in your code. So use something like sub foo() Dim row_number 'this is a variable row_number= application.worksheetfunction. _ match(Range("SI_InvNo"),range("Invoice1"),0) msgbox row_number end sub the '0' idnicates that Match shoud look for an exact match (see the Excel help for more about the MATCH function syntax) -- Regards Frank Kabel Frankfurt, Germany Minitman wrote: Hey Frank, Thanks for the quick response. I don't quite understand this bit of code. I have two named ranges and you referred to only one. Where do I put "SI_InvNo"? Also what are row_number and invoice_number? And finally, what does the 0 indicate? row_number= _ application.worksheetfunction.match(invoice_number ,range("Invoice1"),0) -Minitman On Wed, 14 Apr 2004 19:35:17 +0200, "Frank Kabel" wrote: Hi you could use the worksheet function MATCH in your VBA code. something like row_number=application.worksheetfunction.match(inv oice_number,range("In voice1"),0) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Frank.
That is what I was looking for. I had a bit of trouble getting Excel help to come up with anything on "match", until I tried "MATCH" then it came up. -Minitman On Wed, 14 Apr 2004 21:01:30 +0200, "Frank Kabel" wrote: Hi do you want a VBA solution or a worksheet function. For the first one add the line in your code. So use something like sub foo() Dim row_number 'this is a variable row_number= application.worksheetfunction. _ match(Range("SI_InvNo"),range("Invoice1"),0) msgbox row_number end sub the '0' idnicates that Match shoud look for an exact match (see the Excel help for more about the MATCH function syntax) |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Frank,
I can't get the code to work! I keep getting Run-time error '1004': Method 'Range' of object '_Worksheet' failed Debug highlighted this whole row: row_number= application.worksheetfunction. _ match(Range("SI_InvNo"),range("Invoice1"),0) Any idea as to what is going on? TIA -Minitman On Wed, 14 Apr 2004 14:30:54 -0500, Minitman wrote: Thanks Frank. That is what I was looking for. I had a bit of trouble getting Excel help to come up with anything on "match", until I tried "MATCH" then it came up. -Minitman On Wed, 14 Apr 2004 21:01:30 +0200, "Frank Kabel" wrote: Hi do you want a VBA solution or a worksheet function. For the first one add the line in your code. So use something like sub foo() Dim row_number 'this is a variable row_number= application.worksheetfunction. _ match(Range("SI_InvNo"),range("Invoice1"),0) msgbox row_number end sub the '0' idnicates that Match shoud look for an exact match (see the Excel help for more about the MATCH function syntax) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
only a certain text from a target col | Excel Discussion (Misc queries) | |||
Target.Value | Excel Worksheet Functions | |||
Target cell reference moves when target is cut and pasted | Excel Discussion (Misc queries) | |||
target.value | Excel Discussion (Misc queries) | |||
Target | Excel Worksheet Functions |