Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to find a matching row and Insert Data

Dear all,

I have Excel with two Column, One column is named
Invoice_number and one column is named Checked_Value which will have
default value "" (Blank) . Invoice_number can have several thousand
rows. Now I write a userform1 with a textbox, when the user enter a
Invoice Number in the textbox, the VBA will try to find a matching
value in the the Column Invoice_number. How can I find a matching
value in column Invoice_number with Checked_value equal "". After the
matching invoice number is found , the Checked_Value column will be
changed to "Yes", and this row will not be compared again when the
user enter Invoice number in textbox. How Can I do that?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default How to find a matching row and Insert Data

On Jan 4, 8:58*pm, hon123456 wrote:
Dear all,

* * * * * I have Excel with two Column, One column is named
Invoice_number and one column is named Checked_Value which will have
default value "" (Blank) . Invoice_number can have several thousand
rows. Now I write a userform1 with a textbox, when the user enter a
Invoice Number in the textbox, the VBA will try to find a matching
value in the the Column Invoice_number. How can I find a matching
value in column Invoice_number with Checked_value equal *"". After the
matching invoice number is found , the Checked_Value column will be
changed to "Yes", and this row will not be compared again when the
user enter Invoice number in textbox. How Can I do that?

Thanks


Dim i As String
Dim cell As Range
i = InputBox("Invoice number?")
If i = "" Then Exit Sub
For Each cell In Range("Invoice_number")
If cell.Value = i Then
cell.Offset(0, 1).Select
Selection.Value = "Yes"
End If
Next cell
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to find a matching row and Insert Data

On 1$B7n(B5$BF|(B, $Be8a(B11$B;~(B53$BJ,(B, GTVT06 wrote:
On Jan 4, 8:58 pm, hon123456 wrote:

Dear all,


I have Excel with two Column, One column is named
Invoice_number and one column is named Checked_Value which will have
default value "" (Blank) . Invoice_number can have several thousand
rows. Now I write a userform1 with a textbox, when the user enter a
Invoice Number in the textbox, the VBA will try to find a matching
value in the the Column Invoice_number. How can I find a matching
value in column Invoice_number with Checked_value equal "". After the
matching invoice number is found , the Checked_Value column will be
changed to "Yes", and this row will not be compared again when the
user enter Invoice number in textbox. How Can I do that?


Thanks


Dim i As String
Dim cell As Range
i = InputBox("Invoice number?")
If i = "" Then Exit Sub
For Each cell In Range("Invoice_number")
If cell.Value = i Then
cell.Offset(0, 1).Select
Selection.Value = "Yes"
End If
Next cell


Thanks GTVT06, but I want VBA to Search the Invoice_Number with
Checked_Value = "". Your code seems to search every cell but not the
cell with
Checked_value = "". What I want is the Checked_Value is change to
"Yes, It will not be Search again.

Thanks.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to find a matching row and Insert Data

On 1$B7n(B5$BF|(B, $B2<8a(B12$B;~(B35$BJ,(B, hon123456 wrote:
On 1$B7n(B5$BF|(B, $Be8a(B11$B;~(B53$BJ,(B, GTVT06 wrote:





On Jan 4, 8:58 pm, hon123456 wrote:


Dear all,


I have Excel with two Column, One column is named
Invoice_number and one column is named Checked_Value which will have
default value "" (Blank) . Invoice_number can have several thousand
rows. Now I write a userform1 with a textbox, when the user enter a
Invoice Number in the textbox, the VBA will try to find a matching
value in the the Column Invoice_number. How can I find a matching
value in column Invoice_number with Checked_value equal "". After the
matching invoice number is found , the Checked_Value column will be
changed to "Yes", and this row will not be compared again when the
user enter Invoice number in textbox. How Can I do that?


Thanks


Dim i As String
Dim cell As Range
i = InputBox("Invoice number?")
If i = "" Then Exit Sub
For Each cell In Range("Invoice_number")
If cell.Value = i Then
cell.Offset(0, 1).Select
Selection.Value = "Yes"
End If
Next cell


Thanks GTVT06, but I want VBA to Search the Invoice_Number with
Checked_Value = "". Your code seems to search every cell but not the
cell with
Checked_value = "". What I want is the Checked_Value is change to
"Yes, It will not be Search again.

Thanks.- $Bp,i6Ho0zMQJ8;z(B -

- $Bp}<(Ho0zMQJ8;z(B -


Dear GTVT06,

When the VBA goto the following statement:

For Each cell In Range("Invoice_number")

Error 1004 was generated, the error message is " Range Method (_Global
Object) Failed" . I have type the "Invoice_number" in Cell A1 but it
does not work. Please help. Thanks.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default How to find a matching row and Insert Data

On Jan 4, 10:52 pm, hon123456 wrote:
On 1$B7n(B5$BF|(B, $B2<8a(B12$B;~(B35$BJ,(B, hon123456 wrote:





On 1$B7n(B5$BF|(B, $Be8a(B11$B;~(B53$BJ,(B, GTVT06 wrote:


On Jan 4, 8:58 pm, hon123456 wrote:


Dear all,


I have Excel with two Column, One column is named
Invoice_number and one column is named Checked_Value which will have
default value "" (Blank) . Invoice_number can have several thousand
rows. Now I write a userform1 with a textbox, when the user enter a
Invoice Number in the textbox, the VBA will try to find a matching
value in the the Column Invoice_number. How can I find a matching
value in column Invoice_number with Checked_value equal "". After the
matching invoice number is found , the Checked_Value column will be
changed to "Yes", and this row will not be compared again when the
user enter Invoice number in textbox. How Can I do that?


Thanks


Dim i As String
Dim cell As Range
i = InputBox("Invoice number?")
If i = "" Then Exit Sub
For Each cell In Range("Invoice_number")
If cell.Value = i Then
cell.Offset(0, 1).Select
Selection.Value = "Yes"
End If
Next cell


Thanks GTVT06, but I want VBA to Search the Invoice_Number with
Checked_Value = "". Your code seems to search every cell but not the
cell with
Checked_value = "". What I want is the Checked_Value is change to
"Yes, It will not be Search again.


Thanks.- $Bp,i6Ho0zMQJ8;z(B -


- $Bp}<(Ho0zMQJ8;z(B -


Dear GTVT06,

When the VBA goto the following statement:

For Each cell In Range("Invoice_number")

Error 1004 was generated, the error message is " Range Method (_Global
Object) Failed" . I have type the "Invoice_number" in Cell A1 but it
does not work. Please help. Thanks.- Hide quoted text -

- Show quoted text -


hon123456,
see if this is more like what you were looking for. I also forgot you
were using forms and not inbutboxes, I wrote this using a inputbox but
it can easily be converted to your form. If you need help converting
it over, let me know.

Dim i As String
Dim cell As Range
i = InputBox("Invoice number?")
If i = "" Then Exit Sub
For Each cell In Range("A:A")
If cell.Value = i Then
cell.Offset(0, 1).Select
If Selection.Value = "" Then
Selection.Value = "Yes"
End If
End If
Next cell
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
Find Matching Data Within Numerous Rows SMH Excel Worksheet Functions 9 October 16th 08 07:19 PM
Find matching data in two workbooks franklinbukoski Excel Worksheet Functions 1 May 5th 08 10:08 PM
Formula to Find Matching Data NM Excel Worksheet Functions 2 November 15th 07 05:06 PM
Find Matching Data Two Columns Gilly Excel Worksheet Functions 1 December 1st 06 09:11 PM
Find Matching Data in different columns of different worksheets No Name Excel Programming 0 June 30th 04 10:02 PM


All times are GMT +1. The time now is 10:19 PM.

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"