Hey there,
I'm trying to create a button that would do a string search through Column A (task serial numbers) to determine the next task serial number and insert it into the first empty cell in the column. An example of the column is shown below:
Column A
1 Task#
2 12-1
3 12-2
4 12-3
5 12-4
6 10-1
7 10-2
8 10-3
9 11-1
The number to the left of the hyphen stands for the year and the number to the right of the hyphen stands for the task number for that year. So for any additional tasks assigned this year, the serial number has to start with 12 and the number after the hyphen has to be 1 higher than the previous task. In case of the example above, clicking on the button should insert "12-5" into cell A10. If there hasn't been any tasks assigned for this year (no 12 in front of hyphen), then clicking the button should add the first task serial number (12-1) for 2012 in A10. I'm sure it's a simple solution but I just cannot figure out as I'm still a newbie to VBA. I'd appreciate any help on this. The codes I have been playing with:
Bookmarks