Sub exportJosn()
Dim s As String
Dim fullName As String
Dim Data1 As String
Dim rng As Range
Dim xLen As Integer
Dim yLen As Integer
Dim r1 As Integer
Dim c1 As Integer
fullName = Replace(ActiveWorkbook.fullName, ".xlsm", ".lua")
xLen = Range("a1").CurrentRegion.Columns.Count
yLen = Range("a1").CurrentRegion.Rows.Count
Open fullName For Output As #1
Print #1, "_G.FileName= "
Print #1, "{"
For r1 = 2 To yLen
s = ""
For c1 = 1 To xLen
If (Application.IsNumber(Cells(r1, c1).Value)) Or Left(Cells(r1, c1).Value, 1)
Dim s As String
Dim fullName As String
Dim Data1 As String
Dim rng As Range
Dim xLen As Integer
Dim yLen As Integer
Dim r1 As Integer
Dim c1 As Integer
fullName = Replace(ActiveWorkbook.fullName, ".xlsm", ".lua")
xLen = Range("a1").CurrentRegion.Columns.Count
yLen = Range("a1").CurrentRegion.Rows.Count
Open fullName For Output As #1
Print #1, "_G.FileName= "
Print #1, "{"
For r1 = 2 To yLen
s = ""
For c1 = 1 To xLen
If (Application.IsNumber(Cells(r1, c1).Value)) Or Left(Cells(r1, c1).Value, 1)

这是一个使用VBA宏的Sub过程,用于将Excel工作簿中的数据导出为Lua格式的配置文件。它遍历指定的单元格范围,检查数值或包含双引号的字符串,并正确格式化输出到.lua文件中。最后,它会显示一个消息框确认操作完成。
最低0.47元/天 解锁文章
1084

被折叠的 条评论
为什么被折叠?



