Хз как понять, где там имена колонок, можно номер первой выделенной колонки передать, а дальше они должны по порядку идти, ведь у тебя имена колонок постоянные
Sub SendByPOST()
query = ""
For RowCount = 1 To Selection.Rows.Count
If RowCount > 1 Then
query = query & Chr(13)
End If
For ColumnCount = 1 To Selection.Columns.Count
If ColumnCount > 1 Then
query = query & Chr(9)
End If
query = query & ActiveSheet.Cells(1, Selection.Column + ColumnCount - 1).Text & ":" & Selection.Cells(RowCount, ColumnCount).Text
Next ColumnCount
Next RowCount
Set xmlReq = CreateObject("Microsoft.XMLHTTP")
xmlReq.Open "POST", "http://localhost/xls.php", False
xmlReq.setRequestHeader "Content-Type", "text/xml"
xmlReq.setRequestHeader "Connection", "Close"
xmlReq.setRequestHeader "Content-length", Len(query)
xmlReq.send (query)
If (xmlReq.Status >= 200 And xmlReq.Status < 300) Then
MsgBox "Done"
Else
MsgBox "Filed: " & xmlReq.Status
End If
End Sub
Подразумевается что имена колонок народятся в первой строке, иначе "...Cells(1, Sele..." тут нужно указать строку.