ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Lookup Macro (https://www.excelbanter.com/excel-programming/412496-lookup-macro.html)

lindsey

Lookup Macro
 
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!

Don Guillett

Lookup Macro
 
Pretty easy using conditional formatting
select the cells(s) desiredUse formatconditionalformattingformula
is=J2=$j$1

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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!



lindsey

Lookup Macro
 
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!

"Don Guillett" wrote:

Pretty easy using conditional formatting
select the cells(s) desiredUse formatconditionalformattingformula
is=J2=$j$1

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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!




Don Guillett

Lookup Macro
 

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.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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!

"Don Guillett" wrote:

Pretty easy using conditional formatting
select the cells(s) desiredUse formatconditionalformattingformula
is=J2=$j$1

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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!





lindsey

Lookup Macro
 
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

"Don Guillett" wrote:


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.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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!

"Don Guillett" wrote:

Pretty easy using conditional formatting
select the cells(s) desiredUse formatconditionalformattingformula
is=J2=$j$1

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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!





Don Guillett

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

The macro posted here will search all worksheets until it finds the value
desiredgoto 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.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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

"Don Guillett" wrote:


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.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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!

"Don Guillett" wrote:

Pretty easy using conditional formatting
select the cells(s) desiredUse formatconditionalformattingformula
is=J2=$j$1

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lindsey" wrote in message
...
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!







All times are GMT +1. The time now is 10:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com