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

  • Home
  • SEARCH
  • 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 3284520
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:09:50+00:00 2026-05-17T20:09:50+00:00

I am have a few issues with trying to locate a number that has

  • 0

I am have a few issues with trying to locate a number that has a length equal to or bigger thans 9 digits long.

I have wrote this and if the number is less than 9 it picks it up otherwise it doesnt.

The numbers are in a format like this 1013617518

Sub LoopThroughDirectory()

Application.DisplayAlerts = False
Dim Ifind As String, rngData As Range
Dim rngFound As Range
Dim r As Long

MyPath = "C:/"
activefile = Dir(MyPath & "*.csv")
r = 1

Start:
If Range("A" & r) = "" Then
Exit Sub
End If

Application.ScreenUpdating = False

Do While activefile <> ""
    Ifind = Range("A" & r).Value
    Workbooks.Open Filename:=MyPath & activefile
    Set rngData = ActiveSheet.Range("B:B")
    Set rngFound = rngData.Find(Ifind, LookIn:=xlValues)

    ActiveWorkbook.Close

    If Not rngFound Is Nothing Then
            Range("B" & r) = activefile
            r = r + 1
            GoTo Start
    Else: Range("B" & r) = "Not Found"
    End If

    activefile = Dir()
    Range("A" & r).Select
Loop

Application.ScreenUpdating = True

r = r + 1
activefile = Dir(MyPath & "*.csv")
GoTo Start

Application.Display Alerts = True

End Sub

Any ideas why it isnt picking them up and pickign up shorter numbers would be great

  • 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-17T20:09:50+00:00Added an answer on May 17, 2026 at 8:09 pm

    Change your find statement to

    Set rngFound = rngData.Find(Ifind, LookIn:=xlFormulas)
    

    as numbers above 9 digits are usually displayed in xEy notation unless you take additional precautions. This is safe here as you import a CSV which doesn’t contain “real” formulas.

    hint:
    Have you simulated your Find by hand (i.e. Ctrl-F) before coding? It doesn’t work either, when the CSV is correctly split into rows and you go searching for your 10-digit number “by Value”, but it does work “by Formula”

    Good luck
    MikeD

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

Sidebar

Related Questions

EDIT: After fixing a few issues, the bigger issue that I am having is
I have some code that has got me very close to what Im trying
Having a few issues trying to think of a good way to have a
Ok, I have asked a few questions about different facets of trying to accomplish
I have been trying to optimize an ASP.NET C# application for a few days
I have been having a few issues using the quadrature function in python 2.7
The following site: http://staging.jungledragon.com Has a few rendering issues on the iPad using Safari,
I am having a few issues trying to get some basic jquery functionality working
I am new to Capybara testing and am having a few issues. I have
I'm trying to extend an ObservableCollection with a few custom properties and have it

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.