I am using vba in a CAD program to export data, sort the data, and add data. The following macro is exactly what I want excel to do. However I believe I am limited to having the CAD program tell Excel what to do through VBA. This macro copyies a formula and pastes it to all the populated cells below it in the column.
MACRO CODE:
Range("B1").Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
iLogic Version of Code:
oBook.WorkSheets(1).Name = "Order List"
oBook.WorkSheets(2).Name = "Cut List"
wSheet1 = oBook.WorkSheets("Order List")
wSheet2 = oBook.WorkSheets("Cut List")
wSheet2.Activate
wSheet2.Range("B1").Select
wSheet2.Selection.Copy
wSheet2.Range(Selection, Selection.End(xlDown)).Select
wSheet2.Selection.Paste
Unfortunately I seem to be missing something to translate between Inventor and Excel, but I don't know enough to even know if that's the issue. Any advice is very much appreciated as I am still very new to VBA.
SelectandActivate. AlsoSelectionprobably means nothing to Inventor, and if it does then it doesn't mean the same thing asSelectiondoes when hosted in Excel. You'll want to make thatwSheet2.Application.Selection, or if you have a reference toExcel.Application(you should), then use that object variable to qualify everything that would be global in Excel.