Macro help.

runchie

New Member
Joined
Jun 3, 2011
Messages
8
I am looking to use the contents of my clipboard as a paramater to find.

I have some columns of data

Last|First|Dept|Empl#|Badge1|

and i have a column of data

badge2|

for each cell in badge2 i need to search for the the contents in the Badge1 and if its found i want to highlight the entire row.

Any help would be AWESOME
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
this is what i have.

It seems to work. but it there a more effeciant way of doing it?

Code:
Sub Eight()
Dim myRange As Range
Dim oCell As Object
Application.ScreenUpdating = False
Set myRange = ActiveSheet.Range("H1:" & ActiveSheet.Range("H65536"). _
   End(xlUp).Address)
For Each oCell In myRange
If Not oCell.Value = "" Then
Range("E:E").Select
Selection.Find(What:=oCell, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Select
        ActiveCell.Offset(0, 1).Select
        Range(ActiveCell, ActiveCell.Offset(0, -5)).Select
        Selection.Copy
        oCell.Offset(0, 1).Select
        ActiveSheet.Paste
 
 
ElseIf oCell.Value = "" Then GoTo JumpOut
End If
Next oCell
JumpOut:
Range("A1").Activate
Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top