Hi All
I've been working on a bit of code to do as the title suggests, have tried a variety of things, but they all seem to be having the same affect.
The basic overview is that throughout the month, a colleague will be inputting people to this system, and at the end of the month the data will be sent to our accounts department.
The accounts team need a very specific form, which is fine and is set up - but by default I only want it to have a couple of lines where the employee details are entered, then when the macro is ran, I want it to count how many entries have been input throughout the month from the data capture sheet, and insert this amount of rows into the accounts sheet.
I so far have the below code:
Sheets("Data Capture").Select
nrows = Application.WorksheetFunction.CountA(Worksheets("Data Capture").Range("A:A"))
Sheets("Account Form").Select
Sheets("Account Form").Rows("21").Copy
Sheets("Account Form").Rows("22:" & nrows).Select
ActiveSheet.Paste
Sheets("Data Capture").Select
Range("A3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Account Form").Select
Range("B20").Select
The code is unfinished at the end, as you may be able to see once inputting the rows, it goes back and copies the field, then inputs - this bit is fine, I just haven't got past this obstacle yet.
The problem is, whilst the above affectively does what I want it to, it's inputting the wrong amount of lines. I have added and removed data from the Data Capture form to test, and regardless of there being 3 or 9 cells in "A" with data in, it inputs 19 rows each time!
Anyone able to help with this at all? I have checked the cells and there is no hidden formula's/text or anything in them.
Bookmarks