Lookup Macro

L

Lindsey

I want to create a button that you click, it asks you to enter a number and
then it is highlighted. I have never used macros before, how do you create
formulas? It must be easier than writing codes that only very technical
people understand. Thanks!
 
D

Don Guillett

Pretty easy using conditional formatting
select the cells(s) desired>Use format>conditionalformatting>formula
is>=J2=$j$1
 
L

Lindsey

Is this a macro? and will this create a button a person can click and a
message will pop up and ask for a 6-digit number? I know how to get to the
macro program, but I don't understand how to start one. Thanks!
 
D

Don Guillett

No, It's simpler than that. It uses a cell. As shown if you have numbers in
j2:j??? and you put the number in j1 then all cells with that number will
highlight. Look in the help index for conditional formatting.
 
L

Lindsey

Sorry, I must not be explaining this well or I don't understand. I have an
example of a Macro that I want, but I don't know how to adjust it. I just
want to change the column it looks at. Here it is:

Sub Cusip()
'
' Cusip Macro
' Macro recorded 2/21/2008 by User
'

Dim wsSheet As Worksheet
Dim rFound As Range
Dim strFind As String
Dim iRow As Integer
Dim iCol As Integer

strFind = InputBox(Prompt:="Enter CUSIP")
If strFind = "" Then Exit Sub
For Each wsSheet In ThisWorkbook.Worksheets
'wsSheet.Range("K:K").EntireColumn.Hidden = True
Set rFound = wsSheet.UsedRange. _
Find(What:=strFind, LookIn:=xlValues, LookAt:=xlPart, MatchCase:=False)
If Not rFound Is Nothing Then
Application.Goto rFound, Scroll:=True
'wsSheet.Range("K:K").EntireColumn.Hidden = False
iRow = ActiveCell.Row
'iCol = ActiveCell.Column
'Cells(iRow, 0).Select
'Range(iRow, 0).Select
Range(Selection, ActiveCell.Offset(0, -1)).Select

End
End If
'wsSheet.Range("K:K").EntireColumn.Hidden = False
Next wsSheet

MsgBox "No match"

End Sub
 
D

Don Guillett

Your original post did NOT say that................

The macro posted here will search all worksheets until it finds the value
desired>goto it and hilite it and the cell to the left. It is looking in the
entire worksheet. Are you saying you want to search a specific column ONLY?
If desired, send your workbook to my private address below along with a
detailed explanation of what you do want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top