I'm working on a macro to sort through a report I inport into Excel and prepare it to be put into a pivot table. It combines a variable number of lines into one summary line. Then I want it to select the data it has combined and delete it. I've gotten the first part to work pretty well, but I started to work on the second half of it and it stopped working.
"Code"
Sub test() 'This is what highlights in yellow
'
' test Macro
'
' Copy total poundage up
ActiveCell.Offset(0, 1).Range("A1").Select
selection.End(xlDown).Select ' but "selection" is selected
selection.End(xlDown).Select
selection.Copy
selection.End(xlUp).Select
ActiveCell.Offset(-1, 0).Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
There is more to the code, but I don't think it goes further than this.
It was working fine, then I started getting the "Compile Error: Expected Function or variable" error. Please help!!
"Code"
Sub test() 'This is what highlights in yellow
'
' test Macro
'
' Copy total poundage up
ActiveCell.Offset(0, 1).Range("A1").Select
selection.End(xlDown).Select ' but "selection" is selected
selection.End(xlDown).Select
selection.Copy
selection.End(xlUp).Select
ActiveCell.Offset(-1, 0).Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
There is more to the code, but I don't think it goes further than this.
It was working fine, then I started getting the "Compile Error: Expected Function or variable" error. Please help!!