Joanne has attended:
Excel VBA Intro Intermediate course
Code for copying line above
How can I write a code that copies the line above into a blank row underneath where the line above has a load of formatting and formulae.
RE: Code for copying line above
Hi Joanne, thanks for your query. The easiest way to write this is to record it! It depends a lot on what your're trying to do and the structure of your data, but try recording yourself simply copying the row, moving down a row and pasting. That will take everything with it.
Alternatively, you could do the same and get the code to OFFSET one row down when it performs the copy, and furthermore you could loop through each cell making the value, numberformat etc of the cell below the same as the source cell. VBA is a flexible tool and there are usually more than one way of achieving the same thing. I'd start with the macro recorder and tweak the code from there.
Hope this helps,
Anthony