ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Searching Problem (https://www.excelbanter.com/excel-programming/314566-searching-problem.html)

AndrewAK[_8_]

Searching Problem
 

Private Sub cmdOK_click()
The following code does exactly what is is supposed to do. It takes th
input from the Userform and inserts it into an Empty ActiveCell.

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

do
if isempty(activecell) = false then

'***i think i need to test here to see if the activecell
txtdnum.value***
'***the cell is advanced here***
activecell.offset(1, 0).select

end if
loop until isempty(activecell) = true

'***if the activecell does = txtdnum.value, i don't want to insert 4
'***following vaules. at this point, if the activecell = txtdnum.value
i want
'***the code to reset the activecell back to \"a2\" and be ready fo
new data.

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



All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com