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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:05:21+00:00 2026-06-01T22:05:21+00:00

I have a fairly large Excel csv file that I need to add and

  • 0

I have a fairly large Excel csv file that I need to add " and " to the start and end of each cell.

The cells contain mixed text whether it’s

  • numbers
  • text
  • links

etc, all of which I need to add quotes to the start and end of each cell.

How can I do this?

  • 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-01T22:05:23+00:00Added an answer on June 1, 2026 at 10:05 pm

    I have adapted this code from Excel show leading zero in formula bar

    It uses variant arrays for speed efficiency, updating only the UsedRange portion of the spreadsheet

    • press Alt & F11 together to go the VBE
    • Insert Module
    • copy and paste the code below
    • press Alt & F11 together to go back to Excel
    • run the macro from the Developer tab

    It can be adapted to ignore blanks cells if you so wish – let me know

    Sub AddStrings()
    Dim rng1 As Range
    Dim rngArea As Range
    Dim strRep1 As String
    Dim strRep2 As String
    Dim lngRow As Long
    Dim lngCol As Long
    Dim lngCalc As Long
    Dim X()
    
    
    strRep1 = """"
    strRep2 = """"
    
    ActiveSheet.UsedRange
    Set rng1 = ActiveSheet.UsedRange
    
    'Speed up the code by turning off screenupdating and setting calculation to manual
    'Disable any code events that may occur when writing to cells
    With Application
        lngCalc = .Calculation
        .ScreenUpdating = False
        .Calculation = xlCalculationManual
        .EnableEvents = False
    End With
    
    'Test each area in the user selected range
    
    'Non contiguous range areas are common when using SpecialCells to define specific cell types to work on
    For Each rngArea In rng1.Areas
        'The most common outcome is used for the True outcome to optimise code speed
        If rngArea.Cells.Count > 1 Then
            'If there is more than once cell then set the variant array to the dimensions of the range area
            'Using Value2 provides a useful speed improvement over Value. On my testing it was 2% on blank cells, up to 10% on non-blanks
            X = rngArea.Value2
            For lngRow = 1 To rngArea.Rows.Count
                For lngCol = 1 To rngArea.Columns.Count
                    'replace the leading zeroes
                    X(lngRow, lngCol) = strRep1 & X(lngRow, lngCol) & strRep2
                Next lngCol
            Next lngRow
            'Dump the updated array sans leading zeroes back over the initial range
            rngArea.Value2 = X
        Else
            'caters for a single cell range area. No variant array required
            rngArea.Value = strRep1 & rngArea.Value2 & strRep2
        End If
    Next rngArea
    
    'cleanup the Application settings
    With Application
        .ScreenUpdating = True
        .Calculation = lngCalc
        .EnableEvents = True
    End With
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table (that can be fairly large....say 200x200 px) where each cell
I have a fairly large Excel file. In this file there is a column
I have a fairly large Indesign file with a text field that needs to
I have a fairly large text file that I would like to convert into
I have a fairly large text file from which I need to extrapolate a
I have a fairly large xml file ( greater than 2mb ) that I'm
I have a fairly large pickled (dict) file in binary format that takes few
I have a fairly large codebase that depends on MooTools v1.11 and am about
I have a fairly large PHP codebase (10k files) that I work with using
I have a fairly large CRUD winform app that is set up to display

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.