Private Sub cmdSubmitChangesTo3E_Click()
' create an XML file from an Excel table
Dim varInvIndex As String
Dim varInvElectHistID As String
Dim varDateSubmitted As String
Dim varComments2 As String
Dim i As Long
Dim wb1 As Excel.Workbook
Dim k As Long
ActiveWorkbook.Worksheets("Sheet1").Activate
i = 8
k = 2
Do Until i > Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
' varInvIndex
Worksheets("Sheet2").Range("A" & k) = Cells(i, 5).Value
'varInvElectHistID
Worksheets("Sheet2").Range("b" & k) = Cells(i, 6).Value
' varDateSubmitted
Worksheets("Sheet2").Range("c" & k) = Cells(i, 12).Value
'varComments2
Worksheets("Sheet2").Range("d" & k) = Cells(i, 13).Value
k = k + 1
i = i + 1
Loop
Worksheets("Sheet2").Range("A1").Value = "InvIndex"
Worksheets("Sheet2").Range("B1").Value = "InvElectHistID"
Worksheets("Sheet2").Range("C1").Value = "Date Submitted"
Worksheets("Sheet2").Range("D1").Value = "Comments"
Cells.Select
Cells.EntireColumn.AutoFit
Columns("A:A").Select
Selection.ColumnWidth = 11.57
Cells.Select
Cells.EntireRow.AutoFit
Rows("2:2").Select
'With ActiveWindow
' .SplitColumn = 0
' .SplitRow = 1
'End With
Worksheets("Sheet2").Select
ActiveWindow.FreezePanes = False
Worksheets("Sheet2").Range("A2").Select
ActiveWindow.FreezePanes = True
Worksheets("Sheet2").Range("A2").Select
ActiveWorkbook.Worksheets("Sheet1").Activate
Worksheets("Sheet1").Range("A8").Select
End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.