最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

[Mabinogi]excel讀取指定角色包裹數(shù)據(jù)的VBA

2023-05-26 08:17 作者:快樂的布里爾  | 我要投稿

snowmirai前段時(shí)間更新后可以將角色包裹數(shù)據(jù)保存到本地,但是每個(gè)角色的包裹數(shù)據(jù)都是單獨(dú)保存的,需要找東西要逐個(gè)打開比較笨重。所以花了一下午時(shí)間看了下VBA,寫了個(gè)可以讀取選定角色包裹(單選多選均可)的功能。保存模塊之后在工作表添加一個(gè)按鈕用于加載腳本就行了。

EXCEL VBA個(gè)人感覺是難懂還難用。。。

Sub Import_Item_TXT()

? ? ActiveSheet.Unprotect Password:="mabinogi"

? ??

? ? Dim objStream, StrData, Arr1, i As Long

? ??

? ? 'Dim rows_num

? ??

? ? Dim full_info As String

? ? Dim string_searchResult

? ??

? ? Dim item_name As String, item_other As String, item_id As String

? ? Dim item_id_key As String, item_otherinfo_key As String

? ??

? ? Dim pathX As String, item_Code As String, N As Long

? ??

? ? Dim String_reading As String

? ? String_reading = "已導(dǎo)入文本"

? ??

? ? Dim pathCollection As String

? ??

? ? With Application.FileDialog(msoFileDialogFilePicker)

? ? ? ? '////////////////打開文件/////////////

? ? ? ? With .Filters

? ? ? ? ? ? .Clear

? ? ? ? ? ? .Add "txt_File", "*.txt"

? ? ? ? End With

? ? ? ? .AllowMultiSelect = True

? ? ? ? .Show

? ? ? ? '/////////////////////////////////////

? ? ? ??

? ? ? ? '////////////////清除原有數(shù)據(jù)////////////

? ? ? ? ActiveSheet.UsedRange.ClearContents

? ? ? ? ActiveSheet.Cells.Interior.Pattern = xlNone

? ? ? ? '////////////////////////////////////////

? ? ? ??

? ? ? ? N = 3

? ? ? ? 'rows_num = 1

? ? ? ??

? ? ? ? For lngcount = 1 To .SelectedItems.Count

? ? ? ? ? ? j = 1

? ? ? ? ? ? Set objStream = CreateObject("ADODB.Stream")

? ? ? ? ? ? objStream.Charset = "utf-16"

? ? ? ? ? ? objStream.Open

? ? ? ? ? ? objStream.LoadFromFile (.SelectedItems(lngcount))

? ? ? ? ? ? StrData = objStream.readtext()

? ? ? ? ? ??

? ? ? ? ? ? Arr1 = Split(StrData, vbCrLf)

? ? ? ? ? ? objStream.Close

? ? ? ? ? ? Set objStream = Nothing

? ? ? ? ? ??

? ? ? ? ? ? ActiveSheet.Rows(N).Interior.Color = 65535

? ? ? ? ? ? Range("D" & N) = .SelectedItems(lngcount)

? ? ? ? ? ? For i = 0 To UBound(Arr1)

? ? ? ? ? ? ? ? string_searchResult = 0

? ? ? ? ? ? ? ? full_info = Arr1(i)

? ? ? ? ? ? ? ? '////////////////截取字符串////////////

? ? ? ? ? ? ? ? '? item_id_key? , item_otherinfo_key

? ? ? ? ? ? ? ? item_id_key = "ClassID"

? ? ? ? ? ? ? ? item_otherinfo_key = "Color"

? ? ? ? ? ? ? ? '//////////////////////////////////////


? ? ? ? ? ? ? ? '////////////////查找字符串///////////

? ? ? ? ? ? ? ? If (InStr(full_info, item_id_key)) Then

? ? ? ? ? ? ? ? ? ? string_searchResult = 1

? ? ? ? ? ? ? ? End If

? ? ? ? ? ? ? ? '///////////////////////////////////

? ? ? ? ? ? ? ? If full_info <> "" Then

? ? ? ? ? ? ? ? ? ? If (string_searchResult) Then

? ? ? ? ? ? ? ? ? ? ? ?item_name = Mid(full_info, 10, InStr(full_info, item_id_key) - 11)

? ? ? ? ? ? ? ? ? ? ? ?item_other = Mid(full_info, InStr(full_info, item_otherinfo_key) - 1)

? ? ? ? ? ? ? ? ? ? ? ?item_id = Mid(full_info, InStr(full_info, item_id_key) - 1, Len(Mid(full_info, InStr(full_info, item_id_key) - 1)) - Len(item_other))? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? ? ? ?Range("B" & N) = item_name

? ? ? ? ? ? ? ? ? ? ? ?Range("C" & N) = item_id

? ? ? ? ? ? ? ? ? ? ? ?Range("D" & N) = item_other

? ? ? ? ? ? ? ? ? ? Else

? ? ? ? ? ? ? ? ? ? ? ?Range("A" & N) = full_info

? ? ? ? ? ? ? ? ? ?End If

? ? ? ? ? ? ? ? End If

? ? ? ? ? ? ? ? N = N + 1

? ? ? ? ? ? ? ? string_searchFault = 0

? ? ? ? ? ? Next

? ? ? ? Next lngcount

? ? ? ? 'MsgBox String_reading

? ? End With

? ? ActiveSheet.Protect Password:="mabinogi"

?End Sub


[Mabinogi]excel讀取指定角色包裹數(shù)據(jù)的VBA的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
都匀市| 洛宁县| 仁化县| 花莲市| 伊金霍洛旗| 南开区| 拉孜县| 阳山县| 高密市| 凌海市| 玉树县| 剑川县| 桐柏县| 望奎县| 乐东| 荣昌县| 邹平县| 墨江| 中山市| 华池县| 高唐县| 邯郸县| 浙江省| 同心县| 平阴县| 隆德县| 分宜县| 岑巩县| 鄂尔多斯市| 鄂伦春自治旗| 焉耆| 祁门县| 武强县| 郑州市| 九江县| 金阳县| 红桥区| 青龙| 徐州市| 弥渡县| 全州县|