gamalin قام بنشر سبتمبر 9, 2013 قام بنشر سبتمبر 9, 2013 عند عمل import data من ملف نص وتسجيل الحركات بالماكروا لاعادتها مرة اخرى يسجل الماكرو مسار الملف النصي في الكود ويظل يجلب البيانات منه حتى بتغيير موضع ملف الاكسل هل يمكن تعديل الكود ليجلب البيانات من الملف النصي الموجود في نفس الفلدر وليس في المسار الاصلي لاستخدام الملف نفسه مع مجموعات متشابه في الاسم من الملفات النصية ؟ Sheets("1").Select With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;D:\2013\ãæÇÒíä ÊÍáíáíå\01.TXT", Destination:=Range("$A$1")) .Name = "01" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = 1256 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileOtherDelimiter = ":" .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 _ , 1, 1, 1, 1, 1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False End With
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.