ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Custom Boxes (https://www.excelbanter.com/excel-discussion-misc-queries/4434-custom-boxes.html)

S Swedowski

Custom Boxes
 
In Lotus 123, I could have a popup box ask for specific data and when it was
entered it would go into the cells that I specified. Can Excel do too?

swisse

If you want a simple Search Macro try this one:

Sub SearchAndHighlight()
Dim ThisArea As Range, SearchMe As String
Sheets("Sheet1").Activate
SearchMe = InputBox("Write here what you're looking for.")
If IsEmpty(SearchMe) Then Exit Sub
Set ThisArea = Sheets("Sheet1").Cells.Find(SearchMe, lookat:=xlWhole)
If ThisArea Is Nothing Then
MsgBox SearchMe & " - " & "There is no such entry."
Else
Cells.Interior.ColorIndex = xlColorIndexNone
ThisArea.Interior.ColorIndex = 6
End If
End Sub

This opens an input box which tells you to write what you're looking for in
the worksheet, and when you press OK or Enter it highlights the found cell,
otherwise it will open up a message box telling you "There is no such entry."
I presume that you have some working knowledge with macros, otherwise tell me.

Swisse


All times are GMT +1. The time now is 01:58 PM.

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