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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:32:28+00:00 2026-06-09T01:32:28+00:00

I need help creating a string editing macro for excel in visual basic. I

  • 0

I need help creating a string editing macro for excel in visual basic. I am going to describe what I need to be done but any tiny bit of information would help me if a full answer is not possible. I am creating a redirect list to import into a website. In column A in my excel sheet I have 3,500 URLS that look like this http://www.realitynation.com/tv-shows/snooki-jwoww/drag-queen-lap-dances/17772/attachment/02_shot_jenni_snooki_081-2/ I need to create a redirect list for these pages. The page it needs to redirect to is http://www.realitynation.com/tv-shows/snooki-jwoww/drag-queen-lap-dances/17772/ Look familiar? That is because it is the same URL with the “attachment/…” taken off. I would like to create a macro that can do this for me and place the results in column B. The problem is I have a large background with Java and not Visual Basic, in fact I didn’t even know it was possible to do this in Excel until today. Anyway, I’m not asking anyone to solve my problem but any help or direction would be much appreciated. In the mean time I will be researching some string editing in VB to try and figure this out.

Thank You for your time.

  • 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-09T01:32:30+00:00Added an answer on June 9, 2026 at 1:32 am

    You don’t need vba for this. Copy this formula in Cell B1 and copy it down.

    =LEFT(A1,SEARCH("/attachment",A1,1))
    

    If you still want VBA then see this

    Sub Sample()
        Dim ws As Worksheet
        Dim lRow As Long
    
        Set ws = Sheets("Sheet1")
    
        With ws
            lRow = .Range("A" & .Rows.Count).End(xlUp).Row
    
            .Range("B1:B" & lRow).Formula = "=LEFT(A1,SEARCH(""/attachment"",A1,1))"
        End With
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need a small basic help, I am creating a XML file on the fly
I need help with creating Operator-Overloaded functions please. I tried 2 but I am
Need some help for creating a File and String search engine. The program needs
I need help creating a regular expression that will parse the following string :
I need help creating a regular expression blah blah blah blah <?= __l(array('key'=>'SOMEVALUE','default'=>'string string
I need help creating a regular expression for redirecting my old URL's to new
I need help with creating a C# method that returns the index of the
I need a little help creating a catch-all error handling page in my ICEfaces
i need some help with creating file Im trying in the last hours to
I just need help. Basically I am creating a windows appllication that sends bulk

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.