Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem searching cell text | Excel Discussion (Misc queries) | |||
Searching, matching then searching another list based on the match | Excel Discussion (Misc queries) | |||
Searching the first name only | Excel Discussion (Misc queries) | |||
Column searching problem | New Users to Excel | |||
VBA searching a row | Excel Programming |