Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6534235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:13:34+00:00 2026-05-25T10:13:34+00:00

If i had a column like: ColumnA ——- NUMBER VARCHAR(50 BYTE) TIMESTAMP I’m looking

  • 0

If i had a column like:

ColumnA
-------
NUMBER
VARCHAR(50 BYTE)
TIMESTAMP

I’m looking for a vba function that would work like so:

contains(“string to search for”, cell to search it in)
ie. =contains(“VARCHAR”,A2)
and if the cell does contain it (anywhere in the cell – doesn’t have to start or end the cell) then populate the cell (that uses the function) with “T” else “F”.

so in my example:

ColumnB
-------
F
T
F

Also could I then use this function inside other VBA code like so:

If Len(A2) > 10 and contains("CHAR",A2) Then
 //do stuff
End If

If they have to be separate functions (to use in cells returning “T”/”F” and to use in other VBA code), please provide both.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:13:35+00:00Added an answer on May 25, 2026 at 10:13 am

    You want VBA’s InStr

    For example in a module;

    Public Function Contains(Text As String, Cell As Range) As String
       If InStr(1, Cell.Value, Text, vbTextCompare) Then '//case insensitive
           Contains = "T"
       Else
           Contains = "F"
       End If
    End Function
    

    Enables =Contains("blah", A1) in a worksheet

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine I had an id column and each of its rows contained a number.
I'm trying to parse a file that looks like this: || Column Header A
Looks like other people have had this issue, but I would like to understand
I had to add a new column to my table so I did that
I would like to represent a datatype as a single column in my model,
if A is a column in an excel spreadsheet, I would like to fill
I had to add a column on a text file (edit with Notepad++ on
I had made three tables. Table1=users .And the column names are userid (auto_increment) and
I had a simple table: class test(Base): __tablename__ = 'test' id = Column(Integer, primary_key=True)
Has anyone had this problem? I deleted a column in the table editor and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.