简体   繁体   中英

Excel VBA Placing “Empty” Commas at end of CSV File

I am trying to place 7 commas at the end of a CSV file in order to meet criteria. I have placed a comma in the last cell in order to give me a total of 7 commas for the unused fields, but it yields a comma surrounded by quotes when viewed in Notepad. Here is an example of what I get in Notepad: 63908-0410001,0,3/13/2015,100.0000,7,0,62,,,,RADIO1,,,,,,,,,,,,,,,2037,,,,,,,","

How can I get the commas I need without the quotes?

Range("AJ1").Select
ActiveCell.FormulaR1C1 = ","
Selection.AutoFill Destination:=Range("AJ1:AJ" & LR), Type:=xlFillDefault
Range("AJ1:AJ" & LR).Select

将这4行代码替换为(未经测试)

Range("AJ1:AJ" & LR).Formula = " "

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM