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

Hi guys,
I am a newbie to VBA.
I am trying to use excel as a database.
I want to search for some value in the database, copy the whole row
and paste on another worksheet for viewing.
The qn is how do i select a range from a cell so i can do a find for
the value and then copy the row in which the cell is, and then paste
on another worksht?

pls advise
thanks
alan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default excel as database

to reference the database

set rng = Range("A1").CurrentRegion

a specific column in that rng

Dim rng as Range
Dim rng1 as Range
Dim sStr as String
set rng1 = nothing
set rng = Range("A1").CurrentRegion.Columns(3).Cells
sStr = "ABCD"
set rng1 = rng.Find(What:=sStr)
if not rng1 is nothing then
rng1.EntireRow.copy Destination:= _
Worksheets("Sheet3").Cells(rows.count,1).End(xlup) (2)
End if

See help on the find method for additional arguments and/or turn on the
macro recorder while you do a find manually.



--
Regards,
Tom Ogilvy


"alanq" wrote in message
om...
Hi guys,
I am a newbie to VBA.
I am trying to use excel as a database.
I want to search for some value in the database, copy the whole row
and paste on another worksheet for viewing.
The qn is how do i select a range from a cell so i can do a find for
the value and then copy the row in which the cell is, and then paste
on another worksht?

pls advise
thanks
alan



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
Update Excel Database via Access Main Database with a script Finnbar New Users to Excel 2 November 3rd 08 07:24 PM
Convert Excel database to dBASE database? RPI Marketeer Excel Discussion (Misc queries) 1 January 18th 08 06:25 PM
database query not showing foxpro database How I import data mangat New Users to Excel 1 June 24th 07 03:31 PM
How to make reference to database and if true copy from database? V!p3r Excel Discussion (Misc queries) 4 February 5th 07 02:19 PM
Moved database, how do I change link to the database in excel Toastrack Excel Discussion (Misc queries) 0 October 20th 06 09:36 AM


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