MonsterBait
New Member
- Joined
- May 17, 2012
- Messages
- 10
Hi All,
I wrote a bit of code that's been working great until now.
The Records have reached over 1100 entries and my code doesn't do what I designed it for anymore.
I just need the segment of code to locate a record number in column "A" and make that the active cell.
The offending code (which I wrote and had been working probably for the wrong reasons) is:
Dim CurCell as Range
num2 = Range("UpdateNumber")
Set CurCell = WorkBooks("Database.xlsx").Sheets("Records").Range("$A$2:$A$2000").Cells(num2)
[additional code here which updates the record]
**UpdateNumber is a named range which holds a record number the user has input.
**Some records have been deleted and all blank/empty rows have been removed.
**The first 2 rows of the database are title/headings
Scaled down sample database:
[TABLE="class: grid, width: 500, align: center"]
<TBODY>[TR]
[TD]Title
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Record Number
[/TD]
[TD]Name
[/TD]
[TD]Description
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Tom
[/TD]
[TD]Test Alpha
[/TD]
[TD]1/04/2011
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]****
[/TD]
[TD]Test Bravo
[/TD]
[TD]4/06/2011
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]Harry
[/TD]
[TD]Test Charlie
[/TD]
[TD]7/08/2011
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]Vicki
[/TD]
[TD]Test Delta
[/TD]
[TD]16/08/2011
[/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]Heather
[/TD]
[TD]Test Echo
[/TD]
[TD]2/01/2012
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]
I would be very grateful if someone could point out what I'm doing wrong and hopefully suggest a solution.
Thanks,
Alex
I wrote a bit of code that's been working great until now.

I just need the segment of code to locate a record number in column "A" and make that the active cell.
The offending code (which I wrote and had been working probably for the wrong reasons) is:
Dim CurCell as Range
num2 = Range("UpdateNumber")
Set CurCell = WorkBooks("Database.xlsx").Sheets("Records").Range("$A$2:$A$2000").Cells(num2)
[additional code here which updates the record]
**UpdateNumber is a named range which holds a record number the user has input.
**Some records have been deleted and all blank/empty rows have been removed.
**The first 2 rows of the database are title/headings
Scaled down sample database:
[TABLE="class: grid, width: 500, align: center"]
<TBODY>[TR]
[TD]Title
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Record Number
[/TD]
[TD]Name
[/TD]
[TD]Description
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Tom
[/TD]
[TD]Test Alpha
[/TD]
[TD]1/04/2011
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]****
[/TD]
[TD]Test Bravo
[/TD]
[TD]4/06/2011
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]Harry
[/TD]
[TD]Test Charlie
[/TD]
[TD]7/08/2011
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]Vicki
[/TD]
[TD]Test Delta
[/TD]
[TD]16/08/2011
[/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]Heather
[/TD]
[TD]Test Echo
[/TD]
[TD]2/01/2012
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]
I would be very grateful if someone could point out what I'm doing wrong and hopefully suggest a solution.
Thanks,
Alex