ntweisen
Mechanical
- Jul 12, 2010
- 94
I'm trying to run a script from a CAD software which exports property values into an Excel spreadsheet. I need to then sort the spreadsheet by part numbers (which are located in column G) but my script is not working correctly. My data range is A1:G50. Any ideas on why this isn't working?
Const xlCenter = -4108
Const xlAscending = 1
Const xlYes = 1
Const xlSortOnValues = 0
Const xlSortNormal = 0
Const xlTopToBottom = 1
Const xlPinYin = 1
Set objRange = myworksheet.UsedRange
Set objRange2 = Excel.Range("G1")
objRange.Sort objRange2, xlAscending, , , , , , xlYes
Const xlCenter = -4108
Const xlAscending = 1
Const xlYes = 1
Const xlSortOnValues = 0
Const xlSortNormal = 0
Const xlTopToBottom = 1
Const xlPinYin = 1
Set objRange = myworksheet.UsedRange
Set objRange2 = Excel.Range("G1")
objRange.Sort objRange2, xlAscending, , , , , , xlYes