Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Searching Problem


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

--
AndrewA
-----------------------------------------------------------------------
AndrewAK's Profile: http://www.excelforum.com/member.php...fo&userid=1554
View this thread: http://www.excelforum.com/showthread.php?threadid=27187

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Searching Problem

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


--
Patrick Molloy
Microsoft Excel MVP
---------------------------------
I Feel Great!
---------------------------------
"AndrewAK" wrote in message
...

I'm building an Excel spreedsheet to keep track of items. The code works
great, but I can't search the existing item numbers to see if the item
is already listed. Ideally, I'd like to enter the Item number, have the
code select the matching item number and update the inventory of that
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 sub


--
AndrewAK
------------------------------------------------------------------------
AndrewAK's Profile:
http://www.excelforum.com/member.php...o&userid=15546
View this thread: http://www.excelforum.com/showthread...hreadid=271879



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
Problem searching cell text tommcbrny Excel Discussion (Misc queries) 3 May 15th 08 05:00 PM
Searching, matching then searching another list based on the match A.S. Excel Discussion (Misc queries) 1 December 13th 06 05:08 AM
Searching the first name only Kelly Lim Excel Discussion (Misc queries) 7 June 17th 05 04:31 AM
Column searching problem mikeyts New Users to Excel 2 December 18th 04 09:35 PM
VBA searching a row Fargo Holiday Excel Programming 5 December 24th 03 08:10 PM


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