What data type are letters?

benpatz

New Member
Joined
May 21, 2015
Messages
9
I want to find Lg in my worksheet1. I was wondering what data type I would use?
Every data type i have found has been to do with numbers.

Just beginning,
thanks,
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I'd like to find out how to search through my excel worksheet and find a string and have excel report back to me what cells those are that have the value. Some of the arguments in this code I am not familiar with. But the problem I am having is the code only searches the first cell.

Sub usingfind()
Dim oWrSht As Worksheet
Dim lastrow As Long, i As Long, c As String


Dim MyCell As Range
Set oWrSht = Sheets("Sheet1")


lastrow = oWrSht.Range("A" & Rows.Count).End(xlUp).Row


c = "Lg"


Set MyCell = oWrSht.Range("C1:C" & lastrow).Find(what:=c, LookIn:=xlValues)


If Not MyCell Is Nothing Then
MsgBox "Value found in cell" & MyCell.Address
End If
Exit Sub
 
Upvote 0
Try this:
Run this script from the Sheet named Sheet1
Code:
Sub Find_Me()
'Modified  8/7/2018  10:30:37 PM  EDT
Application.ScreenUpdating = False
Dim r As Range
Dim aaa As String
Dim anss As String
Dim Lastrow As Long
Dim SearchValue As String
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
SearchValue = InputBox("Enter search for value")
    For Each r In Sheets("Sheet1").Range("C1:C" & Lastrow)
        If r.Value = SearchValue Then ans = ans & "  " & r.Address & vbNewLine
    Next
    If ans = "" Then MsgBox "Value  " & SearchValue & "  Not Found": Exit Sub
    anss = "The value  " & SearchValue & " found here"
    
    aaa = Replace(ans, "$", "")
    MsgBox anss & vbNewLine & aaa
Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,581
Messages
6,125,656
Members
449,246
Latest member
jbbtz28

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