Hello, I'm new to the forum. Hope i can help!
Im writing a macro that takes a list of raw data and sorts it in two levels; first by project number then by person. The paramter being sorted is how many hours they worked on a project. These are my fields:
excell row number- Project Number - Person - Hours
1 - 12345 - Timothy Dalton - 4
2 - Rick Allen - 10
3 - Rowan Atkinson - 12
4
5
My raw data looks like this:
Project Number- Person - Hours- row number
12345 - Timothy Dalton - 4 - 1
12345 - Rick Allen - 10 - 2
12345 - Rowan Atkinson - 12 - 3
I've written a macro that sorts these records but I would like to automate the program further by removing the row number. What i want to do is have the program read the person's name in the raw data, then search the list and either enter in the number of hours in the correct place, or if the person's name is not found in the list, add it (i have a counter containing the number of entries per project and a "row starting" entry for each project)
i want to add a new entry via the insertion formula:
Now the problem here is that i need to dynamically indicate the row number when the program is run. If the persons name is not found then the program will insert a new line at the bottom of the entries and then enter in the new information. A variable will act as a pointer to the row numbers so i want the code to be:
Where K is my pointer, but this doesnt work, so how i can i dynamically indicate the row where i want to insert a line, or is there a better way to go about this?
Bookmarks