Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display of Record Set
Dear Friends. I have a table with three fields A,B,C. I need the code for if i pu the value in textbox1 it searchs with Col A, if found then rest o record shown in textbox2 and textbox3. And if it is a new record the append the sheet. What codes i am using are these. dim ws as worksheet dim irow as long set ws= worksheets("Code") irow=ws.cells(rows.count, 1).end(xlup).offset(1,0).row ws.cells(irow, 1).value = me.textbox1.value ws.cells(irow, 2).value = me.textbox2.value ws.cells(irow,3).value = me.textbox3.value Any suggestion please. Syed Haider Al -- Syed Haider Al ----------------------------------------------------------------------- Syed Haider Ali's Profile: http://www.excelforum.com/member.php...fo&userid=2199 View this thread: http://www.excelforum.com/showthread.php?threadid=47650 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display of Record Set
dim ws as worksheet
dim irow as long Dim rng as Range Dim rng1 as Range set ws= worksheets("Code") irow=ws.cells(rows.count, 1).end(xlup).offset(1,0).row set rng = ws.Range(ws.cells(1,1),ws.cells(1,irow - 1)) set rng1 = Application.Find(me.Textbox1.Value) if not rng is nothing then msgbox me.Textbox1.Value & " already exists" Me.Textbox2.Value = rng.offset(0,1) Me.Textbox3.Value = rng.offset(0,2) else ws.cells(irow, 1).value = me.textbox1.value ws.cells(irow, 2).value = me.textbox2.value ws.cells(irow,3).value = me.textbox3.value End if -- Regards, Tom Ogilvy "Syed Haider Ali" <Syed.Haider.Ali.1wydua_1129395909.0974@excelfor um-nospam.com wrote in message news:Syed.Haider.Ali.1wydua_1129395909.0974@excelf orum-nospam.com... Dear Friends. I have a table with three fields A,B,C. I need the code for if i put the value in textbox1 it searchs with Col A, if found then rest of record shown in textbox2 and textbox3. And if it is a new record then append the sheet. What codes i am using are these. dim ws as worksheet dim irow as long set ws= worksheets("Code") irow=ws.cells(rows.count, 1).end(xlup).offset(1,0).row ws.cells(irow, 1).value = me.textbox1.value ws.cells(irow, 2).value = me.textbox2.value ws.cells(irow,3).value = me.textbox3.value Any suggestion please. Syed Haider Ali -- Syed Haider Ali ------------------------------------------------------------------------ Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994 View this thread: http://www.excelforum.com/showthread...hreadid=476504 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display of Record Set
Thanks Tom Ogilvy. -- Syed Haider Ali ------------------------------------------------------------------------ Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994 View this thread: http://www.excelforum.com/showthread...hreadid=476504 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display of Record Set
Dear Tom Ogilvy, An error "Run time error 1004" is appearing at "set rng1=application.find(me.textbox1.value)" Please Solve this one Thanks Syed Haider Al -- Syed Haider Al ----------------------------------------------------------------------- Syed Haider Ali's Profile: http://www.excelforum.com/member.php...fo&userid=2199 View this thread: http://www.excelforum.com/showthread.php?threadid=47650 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filter / Lookup: Display record on new sheet based on category... | Excel Discussion (Misc queries) | |||
Display unique record | Excel Discussion (Misc queries) | |||
How to display set of record s on the forms using previous & next button | Excel Programming | |||
Mouse over Record Display | Excel Programming | |||
record of records count for display... | Excel Programming |