Tecnologia, programação e muito Visual FoxPro.

domingo, 30 de maio de 2010

Re: ]] XL-mania [[ cara export data pada file.text ke excel dengan vba

 

coba pakai ini

    Dim FfullName As String
    Dim newSheet As Worksheet
    Dim openBook As Workbook
   
    Set newSheet = Worksheets.Add
    newSheet.Move After:=Sheets(Sheets.Count)
    FfullName = ThisWorkbook.Path & "\" & Range("F3").Text
   
    Workbooks.OpenText Filename:=FfullName, _
    DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, _
    ConsecutiveDelimiter:=False, _
    Tab:=True, _
    FieldInfo:=Array(Array(1, 1), Array(2, 1), _
                     Array(3, 1), Array(4, 1)), _
    TrailingMinusNumbers:=True

   
    Set openBook = ActiveWorkbook
    ActiveSheet.Cells(1).CurrentRegion.Copy newSheet.Cells(1)
    openBook.Close SaveChanges:=False


file text yg akan diimpor datanya, harus berada di folder yg sama
dengan file ini (namanya kok ya export data to yo..)

nama file text yg akan diimpor mungkin bisa bermacam macam/berganti ganti.
agar tidak perlu mengubah makronya tuliska saja di nama file export data tsb
di sebuah cell tertentu, misal F3

hasil impor data akan selalu ditulis di sheet baru

jika kesulitan membuka file terlampir (*.zi_) agar direname dulu menjadi *.ZIP



2010/5/27 Dobby Paku <dp_140279@yahoo.com>
>
> To para pakar excel....
> saya ada masalah dengan export data dari file.text ke program excel...
> dengan cara vba...
> file terlampier...
> terima kasih atas bantuannya...
>
> salam sukses
> dby

__._,_.___
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| selamat hari raya waisak untuk merayakan... selamat long weekend. |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf          |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message,  melecehkan,  tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan  winzip  jika  perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke  |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/           |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau...  |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html           |
+-------------------------------------------------------------------+
| Message lama ada di :                                             |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id]  |
| http://www.mail-archive.com/xl-mania@yahoogroups.com              |
+-------------------------------------------------------------------+
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


Get great advice about dogs and cats. Visit the Dog & Cat Answers Center.


Get real-time World Cup coverage on the Yahoo! Toolbar. Download now to win a signed team jersey!

.

__,_._,___

Nenhum comentário:

Arquivo do blog