Want to save a CSV that has formula-generated blanks

lisaspencer

New Member
Joined
Jul 20, 2020
Messages
21
Office Version
  1. 365
Platform
  1. MacOS
I use CSVs to upload data online (such as contacts) and they have specific fields. I'm trying to make the form process as easy as possible for someone to do who is a computerphobe, and I found someone's VBA code that I can assign to a button that can basically turn all formulas into values without having to do any copy+pasting or keyboard shortcuts (as I say, because they're a computerphobe and the easiest way to do this is to give them buttons to click on).

This is the VBA code.
VBA Code:
Sub Formulas_into_Values()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
    Cells.Copy
    Cells.PasteSpecial Paste:=xlPasteValues
Next ws
End Sub

The problem I'm having now is that where there are formulas on that page initially that the macro will turn into values, I guess they're not true blanks, and when it's saved as a CSV file, and you upload the CSV, it produces loads of null values where there should be empty cells (so the empty ones shouldn't show up at all).

Can anyone help?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Can you provide us with two things:

1. Post the underlying formula that is being converted to values that is causing issues.

2. View your resulting CSV file in a Text Editor (like NotePad), and copy paste one line that has a problematic value, and show us with value in the line it is.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top