Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Filter / Lookup: Display record on new sheet based on category... MeatLightning Excel Discussion (Misc queries) 1 April 14th 08 12:58 AM
Display unique record BBTMAMA Excel Discussion (Misc queries) 3 September 11th 05 03:40 PM
How to display set of record s on the forms using previous & next button jophy j via OfficeKB.com Excel Programming 0 July 21st 05 07:02 AM
Mouse over Record Display Fable[_18_] Excel Programming 0 September 18th 04 07:09 AM
record of records count for display... BruceJ[_2_] Excel Programming 0 November 11th 03 10:06 PM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"