Remove double double Quotes Vba

Gamba

New Member
Joined
Mar 12, 2020
Messages
3
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi everyone, i need some help, I very appreciated for your collaboration.
I wrote a VBA code to export a sheet to txt file, but my sheet have some cells with Double Quote as text, example: "Program Control". So, when I export to txt, the file wrote " " Program Control " ". I need only Double Quote.
If anyone know how solve that, i very appreciate.
Thanks a lot!!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
It would help if you could post your sheet to text export code
 
Upvote 0
Thanks for your reply.
My export code is so easy.
VBA Code:
    Dim filepath As String
    Dim s2k as WorkSheet
    filepath = ActiveWorkbook.Path & "\model.txt"
    On Error Resume Next
    s2k.SaveAs Filename:=filepath, FileFormat:=xlTextWindows
    On Error GoTo 0
If i need write: TABLE: "COORDINATE SYSTEMS"
my txt wrote: TABLE: ""COORDINATE SYSTEMS""

Thanks again.
 
Upvote 0
How about:

VBA Code:
Sub Macro5()
  Dim filepath As String, s2k As Worksheet
  Application.DisplayAlerts = False
  Application.ScreenUpdating = False
  Set s2k = ActiveSheet
  filepath = ActiveWorkbook.Path & "\model.txt"
  s2k.Copy
  ActiveWorkbook.SaveAs Filename:=filepath, FileFormat:=xlTextPrinter, CreateBackup:=False
  ActiveWorkbook.Close False
  MsgBox "Saved"
End Sub
 
Upvote 0
How about:

VBA Code:
Sub Macro5()
  Dim filepath As String, s2k As Worksheet
  Application.DisplayAlerts = False
  Application.ScreenUpdating = False
  Set s2k = ActiveSheet
  filepath = ActiveWorkbook.Path & "\model.txt"
  s2k.Copy
  ActiveWorkbook.SaveAs Filename:=filepath, FileFormat:=xlTextPrinter, CreateBackup:=False
  ActiveWorkbook.Close False
  MsgBox "Saved"
End Sub

Wow, this works, u solved my problem, i think the principal problem is the format to export the txt.
Thanks a lot Dude!! :D
 
Upvote 0
Im glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,752
Members
448,989
Latest member
mariah3

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