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 8247359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:49:27+00:00 2026-06-07T22:49:27+00:00

suppose it finds some specific text like sa in A2,A4,A5,A6 i need to copy

  • 0

suppose it finds some specific text like “sa” in A2,A4,A5,A6
i need to copy “sohail” in B2,B4,B5,B6 respectively,
like this…

ImageName                   PhotographerName
pirf_20120523_sa0001.jpg    sohail
pirf_20120523_ml0001.jpg    manav
pirf_20120523_sa0001.jpg    sohail
pirf_20120523_sa0001.jpg    sohail
pirf_20120523_sa0001.jpg    sohail
pirf_20120529_sh0005.jpg    shirazi
pirf_20120523_ml0001.jpg    manav 
pirf_20120529_sh0005.jpg    shirazi

i tried to retrieve the addrres where it finds text…

Sub FindinTextInEachCell()

Dim rngX As Range


Set rngX = Worksheets("Sheet1").Range("A1:A10").Find("sa", lookat:=xlPart)
If Not rngX Is Nothing Then
    MsgBox "Found at " & rngX.Address
End If

End Sub
  • 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-06-07T22:49:30+00:00Added an answer on June 7, 2026 at 10:49 pm

    You’re not using Find method properly, it’ll only return the first Range it finds, you’ll have to use findnext() method for subsequent ranges, but since subsequent ranges will duplicate, you’ll have to compare it with the first address found.

    Sub foo()
    On Error Resume Next
    
    Dim rng As Range
    Dim prng As Range
    Dim firstAddress As String
    
    With Worksheets(1).Range("A1:A10")
        Set rng = .Find("sa", LookIn:=xlValues, LookAt:=xlPart)
        If Not rng Is Nothing Then
            firstAddress = rng.Address
            Do
                Set prng = rng
                rng.Offset(0, 1) = "Sohail"
                Set rng = .FindNext(After:=prng)
            Loop While Not rng Is Nothing And rng.Address <> firstAddress
        End If
    End With
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a javascript security question: suppose a page finds out the screen resolution
Readed about 30 minutes, and didn't found some specific for this in this site.
Suppose I have this: $('ul.child').slideUp('slow'); What would be the regex to find 'ul.child' and
Suppose I this have this XML doc, where ... just represents other miscellaneous nodes:
I know that this question might have been asked like 100 times, but, believe
I've been trying to find some straightforward information on this, but I haven't been
Suppose I have some code that would, in theory, compile against any version of
I would like to be able to use Full text search in Code First
I'm trying to compile php with some specific extensions, and I've come across the
I have this Java code some other person wrote, specifically JSPs. I am trying

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.