Home > Software engineering >  Save extracted EXCEL VBA code named column values as XLSX file
Save extracted EXCEL VBA code named column values as XLSX file

Time:11-08



As shown in figure, A great god, please help how to turn left in the order specified column value save as XLSX file, the column A, E, D column (note: each order the number of rows may have change)

CodePudding user response:

The main process:
1. Open the "raw data" workbook;
2. Create a new workbook.
3. The "need" the column from the original data in the table, in turn, is copied to the new workbook in table (Sheet1, for example);
4. Call the new workbook. SaveAs interface function, save to the location of the "reasonable" (path and file name),

An and higher versions of Excel, the default format is when "save as". XLSX;
If you want to save as. XLS format, just must specify the corresponding format parameters,

CodePudding user response:

If use macros button, how to do?

CodePudding user response:

How to do?
Is not according to the reasonable processing procedure, and write "VBA code implements"!!!!!!

CodePudding user response:

 
Sheet1. Columns (" E "E"). SpecialCells (2, 19). SpecialCells (12). Copy Sheet2. (B1)
'Sheet1 E column 2 to 19 line copy to Sheet2 B column, note are two different tables, not two different Excel

Sheet1. Columns (" D: D "). The SpecialCells (2, 19). SpecialCells (12). Copy Sheet2. [C1]
'Sheet1 D column 2 to 19 line copy to Sheet2 C column, note are two different tables, not two different Excel
'this is the original copies the data in the table into a new table, is not a new Excel


For two different between Excel copy you can according to this way of thinking is not difficult to implement,
  •  Tags:  
  • VBA
  • Related