diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e1710e..14645c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +### [1.2.0] - 2020-05-29 + +#### Added + +- Implemented option for exporting data values surrounded by user-definable quotes. + User can select whether to quote all exported values, or just + non-numeric values (as determined by VBA's `IsNumeric` built-in). + + ### [1.2.0.dev2] - 2020-02-07 #### Fixed @@ -32,6 +41,7 @@ the below new features as "final". - An option is now provided to export the cells from one or more rows on the active sheet above/below the exported data block as "header row(s)" + ### [1.1.0] - 2019-01-08 #### Added @@ -64,6 +74,7 @@ the below new features as "final". - Error handling added around folder selection and output file opening for write/append + ### [1.0.0] - 2016-01-30 *Initial release* diff --git a/src/Exporter.bas b/src/Exporter.bas index eb7373b..308a4d8 100644 --- a/src/Exporter.bas +++ b/src/Exporter.bas @@ -1,5 +1,4 @@ Attribute VB_Name = "Exporter" - ' # ------------------------------------------------------------------------------ ' # Name: Exporter.bas ' # Purpose: Helper module for launching the CSV Exporter add-in diff --git a/src/UFExporter.frm b/src/UFExporter.frm index fc37162..abcc212 100644 --- a/src/UFExporter.frm +++ b/src/UFExporter.frm @@ -1,10 +1,10 @@ VERSION 5.00 Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} UFExporter Caption = "Export Data Range" - ClientHeight = 5955 + ClientHeight = 6090 ClientLeft = 45 ClientTop = 375 - ClientWidth = 4560 + ClientWidth = 4755 OleObjectBlob = "UFExporter.frx":0000 ShowModal = 0 'False StartUpPosition = 1 'CenterOwner @@ -14,9 +14,6 @@ Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False - - - ' # ------------------------------------------------------------------------------ ' # Name: UFExporter.frm ' # Purpose: Core UserForm for the CSV Exporter Excel VBA Add-In @@ -602,7 +599,21 @@ Private Sub writeCSV(dataRg As Range, tStrm As TextStream, nFormat As String, _ ' visible or if hidden output indicated If ChBxHiddenCols.Value Or _ Not dataRg.Cells(idxRow, idxCol).EntireColumn.Hidden Then - workStr = workStr & Format(dataRg.Cells(idxRow, idxCol).Value, nFormat) + Set cel = dataRg.Cells(idxRow, idxCol) + + ' Output value to CSV with surrounding quotes if indicated + If ( _ + ChBxQuote.Value And ( _ + OpBtnQuoteAll.Value _ + Or (OpBtnQuoteNonnum.Value And Not IsNumeric(cel.Value)) _ + ) _ + ) Then + workStr = workStr & TxBxQuoteChar.Value & _ + Format(cel.Value, nFormat) & TxBxQuoteChar.Value + Else + workStr = workStr & Format(dataRg.Cells(idxRow, idxCol).Value, nFormat) + End If + workStr = workStr & Separator End If Next idxCol diff --git a/src/UFExporter.frx b/src/UFExporter.frx index fe2f963..adb39d3 100644 Binary files a/src/UFExporter.frx and b/src/UFExporter.frx differ