View Single Post
  #2   Report Post  
JMB
 
Posts: n/a
Default

sounds like your question is how to find the row number that contains the
item number that was input.

One way to do that:


Sub test()
Const x As Byte = 3
Const Make As String = "XYZ"
Const Model As String = "AB100"
Const Cost As Long = 500
Dim Row1 As Long

Row1 = Application.Match(x, Sheet1.Range("A:A"), 0)
With Sheet1
.Cells(Row1, 2).Value = 100
.Cells(Row1, 3).Value = Make
.Cells(Row1, 4).Value = Model
.Cells(Row1, 5).Value = Cost
End With

End Sub


where x = the item number input by the user. also, I should point out I am
using the code name for the worksheet. you may need to change it for your
spreadsheet.



"Soundman" wrote:


Hi all,

I'm a newbie, so please be gentle :)

Here's my project.
I've got a sales spreadsheet that I've got one user form that adds
initial data
(item#, qty, make, model, cost) to consecutive rows. I have given them
constant Item
numbers in column A # 1-120. This part works great. I'm trying to get a
new
user form to go back & add actual cost & shipping into new columns
based on
what item number the user types into a text box in the same user form
as the
additional data.

IE: I have items 1 - 5 & want to add actual cost & shipping to item 3.
The user
would pop up the form from a button with a macro & the fields would ask
for
item#, actual cost & actual shipping. The user inputs this info & it
finds the
correct item & adds the new info.

I'm sure this is pretty basic, but I don't know how to make it find the
correct
item# .

Can anyone help?

Thanks!!!


--
Soundman
------------------------------------------------------------------------
Soundman's Profile: http://www.excelforum.com/member.php...o&userid=24428
View this thread: http://www.excelforum.com/showthread...hreadid=380316