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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:38:04+00:00 2026-05-29T21:38:04+00:00

I am going to show a bit of a contrived example, so bear with

  • 0

I am going to show a bit of a contrived example, so bear with it.

Our product makes use of CSV files for transitional data, data sent between an Excel user interface, a Java program to manipulate and transfer it to a SQL backend. We have a VBA script that handles all the Excel work in the following order:

Load all 8 CSV files into 8 sheets in a single Excel document. Then iterate over batches of the data doing the following:

'Loop over data:
    Dim r As Range
    ...
    r.NumberFormat = "General"
    r.Formula = r.Formula
'End loop

This causes the entire sheet to be populated with data from CSV, with number cells to have text appearance and Excel formulas to remain unevaluated. Running r.Formula = r.Formula triggers all the functions to evaluate properly. The only problem is the number formatting.

The CSV files sometimes contain nested CSV. For example, a single cell may contain “1,2,3,15,654” These cells always appear as text. However, there is an edge case, wherein the cells could be pretty print numbers, such as “10,456,345” Excel will convert these numbers into Number cells after evaluating all the functions, and strip out all of the commas. While the 20,000 or so rows in the document are otherwise correct, the 4 or so rows this affects breaks the entire system.

Is there a way to trigger Excel to evaluate the functions from CSV without changing the cell formatting entirely from VBA? Changing formats from CSV to SYLK is not an option, as the Java CSV Generator is handled by a different division.

  • 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-29T21:38:06+00:00Added an answer on May 29, 2026 at 9:38 pm

    You could turn formatting to text on all the cells (Cells.NumberFormat=”@”) then loop over them and use your code on cells which start with ‘=’.
    If performance is an issue you should put the worksheet content in an array, work on the array and put it back to the sheet.
    If you post more code and sample data people will be able to have a closer look.

    EDIT

    for example, putting the following values in column A (from A1 to A4) of “Sheet1”, with a Text formatting:

    13246
    13564,4654,4565
    654
    =A1+A3
    

    and using the following code:

    Sub test()
    
        Dim a As Variant
        Dim result As Variant
    
        a = Sheets("Sheet1").UsedRange
        ReDim result(1 To UBound(a, 1), 1 To UBound(a, 2)) As Variant
    
        For i = 1 To UBound(a, 1)
          For j = 1 To UBound(a, 2)
            If Left(a(i, j), 1) = "=" Then
              result(i, j) = a(i, j)
            Else
              result(i, j) = "'" & a(i, j)
            End If
          Next j
        Next i
    
        Sheets("Sheet1").Cells(1, 2).Resize(UBound(result, 1), UBound(result, 2)) = result
    
    End Sub
    

    The result is put in column B and is :

    13246
    13564,4654,4565
    654
    13900
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bit of a challenge. In an earlier version of our product,
First I'm going to show you an image of what I'm trying to recreate
I'm going to deploy my Java game to show it to my friends and
I am trying to show a progress bar while my process is going on...in
I am trying to show a progress bar while my process is going on...in
i try to show and hide divs on click but something isnt going wel
I really don't know how to explain what's going on, so I'll just show
Going from the example given here... http://ericswann.org/blog/archive/2009/04/06/linq-to-sql-datacontext-provider-revisited.aspx I'm trying to use the datacontext between
Going to http://www.example.com/node/NID/edit , where NID is any valid nid referring to a node
I have a flex application and need to show the real time data into

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.