ID Number with 18 digits as CSV File

kjbroome

New Member
Joined
Oct 15, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello All!

I am searching for a solution to convert an Excel list to a CSV file with an ID number. The number is 18 digits and that means I have two problems. The length of the number and the export into a CSV file which is not able to have a formating.

Can somebody help? Thank you

KJ
 

Attachments

  • excel 1.png
    excel 1.png
    32.4 KB · Views: 28

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
try this:

VBA Code:
Sub outputtotextfile()
wline = ""

For r = 1 To Cells(Rows.Count, "A").End(xlUp).Row
    c = Cells(1, Columns.Count).End(xlToLeft).Column
    wline = wline & Join(Application.Transpose(Application.Transpose(Range("A" & r).Resize(, c))), ",") & vbNewLine
Next r
    
    
'    Open "C:\results\test2.txt" For Append As #1 'add to existing file
    Open "C:\results\test2.csv" For Output As #1 'Replaces existing file
    Print #1, wline
    Close #1

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,948
Members
449,198
Latest member
MhammadishaqKhan

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