Searching Problem

  • Thread starter Thread starter AndrewAK
  • Start date Start date
A

AndrewAK

I'm building an Excel spreedsheet to keep track of items. The code work
great, but I can't search the existing item numbers to see if the ite
is already listed. Ideally, I'd like to enter the Item number, have th
code select the matching item number and update the inventory of tha
item.

Here is the code as it stands. The code is part of a Command Button.

private sub cmdok_click()

activeworkbook.sheets(\"rid sheet\").activate
range(\"a2\").select

do
if isempty(activecell) = false then

activecell.offset(1, 0).select

end if
loop until isempty(activecell) = true

activecell.value = txtdnum.value
activecell.offset(0, 1) = cbodescription.value
activecell.offset(0, 2) = txtcount.value
activecell.offset(0, 3) = txtserialnum.value
range(\"a2\").select
end su
 
private sub cmdok_click()
dim target as range
set range = worksheets("rid
sheet").range(\"a2\").end(xldown).offset(1,0)
with target
.value = txtdnum.value
.offset(0, 1) = cbodescription.value
.offset(0, 2) = txtcount.value
.offset(0, 3) = txtserialnum.value
end with
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top