Käynnissä

Excel VB script to import / export data

I need to create an import macro and an export macro that can be assigned to two CommandButtons. The export macro will export all data from the ranges below, which includes 12 worksheets, and will only export plain text to a temporary file. The import macto will import all data back into the ranges below for each worksheet.

The code below is basically what it needs to export / import.

It does not have to be a .CSV file, it could be anything that would do this effectively, although only plain text should be imported / exported and no formatting.

Thanks!

' January

Sheets("January").Select

Range("January!A14:D31,F14:O31")

Range("January!V14:X31")

Range("P14:P31")

' February

Sheets("February").Select

Range("February!A14:D31,F14:O31")

Range("February!V14:X31")

Range("P14:P31")

' March

Sheets("March").Select

Range("March!A14:D31,F14:O31")

Range("December!V14:X31")

Range("P14:P31")

' April

Sheets("April").Select

Range("April!A14:D31,F14:O31")

Range("April!V14:X31")

Range("P14:P31")

' May

Sheets("May").Select

Range("May!A14:D31,F14:O31")

Range("May!V14:X31")

Range("P14:P31")

' June

Sheets("June").Select

Range("June!A14:D31,F14:O31")

Range("June!V14:X31")

Range("P14:P31")

' July

Sheets("July").Select

Range("July!A14:D31,F14:O31")

Range("July!V14:X31")

Range("P14:P31")

' August

Sheets("August").Select

Range("August!A14:D31,F14:O31")

Range("August!V14:X31")

Range("P14:P31")

' September

Sheets("September").Select

Range("September!A14:D31,F14:O31")

Range("September!V14:X31")

Range("P14:P31")

' October

Sheets("October").Select

Range("October!A14:D31,F14:O31")

Range("October!V14:X31")

Range("P14:P31")

' November

Sheets("November").Select

Range("November!A14:D31,F14:O31")

Range("November!V14:X31")

Range("P14:P31")

' December

Sheets("December").Select

Range("December!A14:D31,F14:O31")

Range("December!V14:X31")

Range("P14:P31")

Taidot: Excel, Visual Basic

Näytä lisää: export script, script import text data excel, excel export csv vbscript, script import excel, vbscript import text excel, export excel vbscript, import script, script excel, vb this, script sheets, script data import export, import export text file excel script, script export data, export text file excel, script export excel data text file, excel script import csv, script import export excel data, data export excel, excel import csv script, vbscript import text file worksheet, vba sscript import text, vbscript import data, vba script importing text, vbscript export excel sheet text file, txt file import sheet excel script

Tietoa työnantajasta:
( 3 arvostelua ) Framlingham, United Kingdom

Projektin tunnus: #445005