Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Macro driven record locator.

I have a large worksheet containing around 1000 rows of data.Column "A"
contains a unique ID code for each row.I would like to be able to quickly
locate a particular record (Row) by entering the ID code in a cell then
navigate to it by clicking on a button ( coded with a macro) to take the user
to the location specified by the cell contents.
Does anyone have any ideas. Thanksi n advance

Malcolm McMaster
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 230
Default Macro driven record locator.

Malcolm,

Maybe something like this will do what you want. Just change D1 to the
column that holds the IDs.

Private Sub CommandButton1_Click()
n = ActiveCell.Value
Range("D1").Activate
Cells.Find(What:=n, After:=ActiveCell, LookIn:=xlValues, Lookat:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
End Sub

A variation on that is as follows. (This will find the cell after the ID
has been typd and the double click that cell. Again just change D1 to the
required column.) You could actually have both procedures so that the user
can employ either method.

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
n = ActiveCell.Value
Range("D1").Activate
Cells.Find(What:=n, After:=ActiveCell, LookIn:=xlValues, Lookat:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
Cancel = True
End Sub

Rob

"Malcolm McMaster" wrote in
message ...
I have a large worksheet containing around 1000 rows of data.Column "A"
contains a unique ID code for each row.I would like to be able to quickly
locate a particular record (Row) by entering the ID code in a cell then
navigate to it by clicking on a button ( coded with a macro) to take the
user
to the location specified by the cell contents.
Does anyone have any ideas. Thanksi n advance

Malcolm McMaster



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
Paramater driven value Andrew Excel Worksheet Functions 2 January 29th 08 12:19 PM
What does it mean to record the macro Liz Excel Discussion (Misc queries) 6 March 15th 07 07:35 PM
Record New Macro ju1eshart Setting up and Configuration of Excel 3 August 25th 06 04:21 PM
Drawing driven database updates Kennard Excel Discussion (Misc queries) 1 February 13th 06 03:40 AM
Date driven formula/worksheet Corey Excel Discussion (Misc queries) 10 November 5th 05 12:43 AM


All times are GMT +1. The time now is 04:08 PM.

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

About Us

"It's about Microsoft Excel"