Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Help needed with modifying this code

Hi

I use these macros to highlight and find the next occurrence of a name in a
column.

Could anyone modify the code so when the code finds the last occurrence of a
name it does not start at the top of the column again.

and Sub findup not to go to the bottom of the column again.

example

Hightlight Cell

Sub Finddown()
Bill
Bill
Bill
Stop the macro


Stop the macro
Ben
Ben
Ben
Sub findup()



Sub Finddown()

Dim FoundCell As Range
Set FoundCell = ActiveCell.EntireColumn.Find(What:=ActiveCell.Valu e, _
After:=ActiveCell, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not FoundCell Is Nothing Then
FoundCell.Select
End If

End Sub

------------------------------------------

Sub findup()

On Error Resume Next
With ActiveCell
..EntireColumn.Find(What:=.Text, After:=.Cells(1, 1), LookAt:=xlWhole, _
LookIn:=xlValues, SearchDirection:=xlPrevious, MatchCase:=False).Select
End With

End Sub


Thanks in advance

Dave


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Help needed with modifying this code

Sub Finddown()

Dim FoundCell As Range
Set FoundCell = ActiveCell.EntireColumn.Find(What:=ActiveCell.Valu e, _
After:=ActiveCell, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not FoundCell Is Nothing
if foundcell.row activecell.row Then FoundCell.Select
End If

End Sub

--
HTH...

Jim Thomlinson


"DaveM" wrote:

Hi

I use these macros to highlight and find the next occurrence of a name in a
column.

Could anyone modify the code so when the code finds the last occurrence of a
name it does not start at the top of the column again.

and Sub findup not to go to the bottom of the column again.

example

Hightlight Cell

Sub Finddown()
Bill
Bill
Bill
Stop the macro


Stop the macro
Ben
Ben
Ben
Sub findup()



Sub Finddown()

Dim FoundCell As Range
Set FoundCell = ActiveCell.EntireColumn.Find(What:=ActiveCell.Valu e, _
After:=ActiveCell, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not FoundCell Is Nothing Then
FoundCell.Select
End If

End Sub

------------------------------------------

Sub findup()

On Error Resume Next
With ActiveCell
..EntireColumn.Find(What:=.Text, After:=.Cells(1, 1), LookAt:=xlWhole, _
LookIn:=xlValues, SearchDirection:=xlPrevious, MatchCase:=False).Select
End With

End Sub


Thanks in advance

Dave



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
Help needed with Modifying 2 Macros DaveM[_2_] Excel Programming 4 June 26th 08 02:12 PM
Need Help Modifying Code Please Office_Novice Excel Programming 3 March 19th 08 11:56 PM
Looking for Help in modifying a code [email protected] Excel Programming 6 January 31st 08 01:57 AM
Help is needed for modifying this code. J_J Excel Programming 2 October 10th 04 09:59 PM


All times are GMT +1. The time now is 03:57 PM.

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"