Hello everyone, had a project assigned to me and I've never used vba so I'm a bit stuck.
I'm attempting to write a simple piece of code to correct a formatting error in a spreadsheet. To fix the error I need to move a row of data up one row and to the right 2 cells. Then Delete the empty row and repeat until the end of the section that is messed up. I currently have the user selecting the range to copy, the cell to paste to and the row to stop at. The copy and paste aspect is working as intended however the macro isn't incrementing the rows correctly. This plus the deleting of rows I believe is causing the macro to crash. Is it possible to increment the rows of a range? When I try datarange.col = datarange.col + 1 I get an error. Thank you for any help you can give. And if you need any additional information just let me know.
I'm attempting to write a simple piece of code to correct a formatting error in a spreadsheet. To fix the error I need to move a row of data up one row and to the right 2 cells. Then Delete the empty row and repeat until the end of the section that is messed up. I currently have the user selecting the range to copy, the cell to paste to and the row to stop at. The copy and paste aspect is working as intended however the macro isn't incrementing the rows correctly. This plus the deleting of rows I believe is causing the macro to crash. Is it possible to increment the rows of a range? When I try datarange.col = datarange.col + 1 I get an error. Thank you for any help you can give. And if you need any additional information just let me know.