add function to take multiple selections and put them into json

This commit is contained in:
Paul Trowbridge 2017-08-24 00:01:53 -04:00
parent 3a873c9fdb
commit 12e466714f

33
FL.bas
View File

@ -627,3 +627,36 @@ Sub markdown_from_table()
Call wapi.ClipBoard_SetData(md) Call wapi.ClipBoard_SetData(md)
End Sub End Sub
Sub json_multirange()
Dim wapi As New Windows_API
Dim x As New TheBigOne
Dim r As range
Dim ar As range
Dim r1() As Variant
Dim r2() As Variant
Dim rslt As String
Dim d() As String
Dim i As Integer
Dim dest As String
Set r = Selection
i = 1
For Each ar In r.Areas
r1 = ar
If i > 1 Then
rslt = rslt & "," & x.json_from_table(r1, CStr(r1(1, 1)), True)
Else
rslt = x.json_from_table(r1, CStr(r1(1, 1)), True)
End If
i = i + 1
Next ar
rslt = "{" & rslt & "}"
Call wapi.ClipBoard_SetData(rslt)
End Sub