You are on page 1of 1

Module1 - 1

Option Explicit
Sub
Dim
Dim
Dim
Dim
Dim

Searchdata()
search As String
finalrow As Integer
column As Integer
x As Integer
y As Integer

search = InputBox("Term to seach:")


column = InputBox("In what column do you want to search? Those are the following columns: A=1, B=2,
C=3, D=4, E=5")
Range("L8:P40").Select
Selection.ClearContents
finalrow = Range("A16").End(xlUp).Row
For x = 9 To finalrow
If Cells(x, column) = search Then
Range(Cells(x, 1), Cells(x, 5)).Copy
Range("K100").End(xlUp).Offset(1, 0).PasteSpecial
End If
Next x
For y = 8 To 20
If Cells(y, 15) = "Texas" Then
Range(Cells(y, 11), Cells(y, 15)).Font.Color = vbBlue
End If
Next y
End Sub

You might also like