Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Carl Brehm
 
Posts: n/a
Default Application.WorksheetFunction.Match problem

Why does the following work, unless Vendor_Number ends in a 0?
1 works but 100 does not
Leaving Vendor_Row = 0 when there is a 100 to match.

Could there be a formatting problem?
All Range("ven_no") is formatted as Text


Sub post_vendor_totals()
Dim Vendor_row As Double
Dim Vendor_Number As Integer
Dim VEN_ROW As Double
Dim column_num As String

Vendor_Number = Application.InputBox("Enter Vendor Number", "Vendor Number", , , , , , 1)
column_num = Sheets("sheet1").Range("i3").Value

On Error Resume Next
Vendor_row = Application.WorksheetFunction.Match(Vendor_Number, Range("ven_no"), 0)
On Error GoTo 0
If Vendor_row = 0 Then
Exit Sub
Else
Vendor_row = Vendor_row + 2
Sheets("sheet2").Range("b" & Vendor_row).Value = Sheets("sheet1").Range("d1").Value
End If

more code..

Thanks
Carl Brehm
Lake Lafourche Bird House
Hebert, LA

Keets, Tiels, GN Lories, Quakers
Mitred Conures, TAG's, Bourkes
Lovebirds, Cherry Head Conures
Prince of Whales

Wholesale Cages to Breeders & Pet Stores
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Try declaring Vendor_Number as string

Dim Vendor_Number As String

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Carl Brehm" wrote in message ...
Why does the following work, unless Vendor_Number ends in a 0?
1 works but 100 does not
Leaving Vendor_Row = 0 when there is a 100 to match.

Could there be a formatting problem?
All Range("ven_no") is formatted as Text


Sub post_vendor_totals()
Dim Vendor_row As Double
Dim Vendor_Number As Integer
Dim VEN_ROW As Double
Dim column_num As String

Vendor_Number = Application.InputBox("Enter Vendor Number", "Vendor Number", , , , , , 1)
column_num = Sheets("sheet1").Range("i3").Value

On Error Resume Next
Vendor_row = Application.WorksheetFunction.Match(Vendor_Number, Range("ven_no"), 0)
On Error GoTo 0
If Vendor_row = 0 Then
Exit Sub
Else
Vendor_row = Vendor_row + 2
Sheets("sheet2").Range("b" & Vendor_row).Value = Sheets("sheet1").Range("d1").Value
End If

more code..

Thanks
Carl Brehm
Lake Lafourche Bird House
Hebert, LA

Keets, Tiels, GN Lories, Quakers
Mitred Conures, TAG's, Bourkes
Lovebirds, Cherry Head Conures
Prince of Whales

Wholesale Cages to Breeders & Pet Stores
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
Row Autofit problem Excel 2003 Matthias Klaey Excel Discussion (Misc queries) 0 January 19th 05 06:33 PM
Baffling formula problem Ken Schmidt Excel Discussion (Misc queries) 2 December 21st 04 08:52 AM
Paper Tray selection Problem, Michael Hoffmann Excel Discussion (Misc queries) 4 December 3rd 04 10:08 PM
label problem Raven Maniac Excel Worksheet Functions 5 November 10th 04 11:10 PM
Problem with Pivot Table Drop-Down Menus Mac Excel Worksheet Functions 4 November 7th 04 02:18 PM


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